question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: ReferenceError when bundling plugin with flipper-pkg

See original GitHub issue

Hi, I am trying to publish my plugin but when I execute flipper-pkg bundle in a folder with a plugin, following error occurs

ReferenceError: SHA-1 for file /home/maksim/IdeaProjects/flipper-plugin/desktop/plugins/adb-plugin/src/index.tsx (/home/maksim/IdeaProjects/flipper-plugin/desktop/plugins/adb-plugin/src/index.tsx) is not computed at DependencyGraph.getSha1 (/home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/node-haste/DependencyGraph.js:338:13) at /home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:254:26 at Generator.next (<anonymous>) at asyncGeneratorStep (/home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:68:24) at _next (/home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:90:9) at /home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:97:7 at new Promise (<anonymous>) at /home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:86:12 at Transformer.transformFile (/home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/DeltaBundler/Transformer.js:283:7) at /home/linuxbrew/.linuxbrew/lib/node_modules/flipper-pkg/node_modules/metro/src/Bundler.js:95:34 🥵 Build failed

flipper-pkg version: flipper-pkg -v flipper-pkg/0.52.1 linux-x64 node-v14.1.0

npm version: npm --version 6.14.7

package.json for a plugin can be found here: https://github.com/maxim-pandra/adb-flipper-plugin/blob/adb-plugin/desktop/plugins/adb-plugin/package.json

Please advise what should I do, I updated npm with npm install -g npm@latest and reinstalled flipper-pkg

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nikoantcommented, Aug 24, 2020

Hi @maxim-pandra! I’ve cloned your repo, and also got an error on flipper-pkg bundle. However it is a bit different on MacOS. I suspect that this issue only happens with globally installed “flipper-pkg”. Could you try to invoke yarn flipper-pkg bundle instead of flipper-pkg bundle? It will use “flipper-pkg” from the repo (located in /desktop/pkg/) instead of globally installed. On my machine this command succeeded.

1reaction
mweststratecommented, Aug 18, 2020

What might go wrong here is that the flipper checkout is not the normal place to develop a plugin (although it can be convenient), so flipper-pkg might not support that case (@nikoant ) might now better. Typically, a plugin is developed somewhere in a local folder, not directly in the Flipper repo, so that you can manage it in your own git repo, etc. See: https://fbflipper.com/docs/extending/js-setup#workflow

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError: $ is not defined after bundling with ...
I ended up doing this: In webpack.config.js : At the top of the file: var webpack = require("webpack");. in the plugins property:
Read more >
Loading error, how to solve - WordPress.org
apbct-public-bundle.min.js:1 Uncaught ReferenceError: ctPublic is not defined ... Please update the Anti-Spam plugin according to this guide:
Read more >
ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found