New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Extension - cannot find module with parcel build
, even though parcel watch
works
#8567
Comments
I ran into a similar problem. Here is a minimal reproduction for the error I'm seeing. My workaround so far was to start parcel with |
@clentfort Thanks for your response, but I'm not quite sure how to leverage the This is what I have currently:
These are all the variations I've tried: # error: unknown option '--no-hmr'
"build-v2": "tsc && rimraf -rf ./dist-v2 && parcel build manifest-v2/manifest.json --dist-dir dist-v2 --config @parcel/config-webextension --no-hmr"
# error: unknown option '--no-hmr'
"build-v2": "tsc && rimraf -rf ./dist-v2 && parcel build --no-hmr manifest-v2/manifest.json --dist-dir dist-v2 --config @parcel/config-webextension"
# unknown: Entry C:\Users\[redacted]\Programming\[repo name]\build does not exist
"build-v2": "tsc && rimraf -rf ./dist-v2 && parcel --no-hmr build manifest-v2/manifest.json --dist-dir dist-v2 --config @parcel/config-webextension"
# Doesn't seem to have any effect, issue still prevent after build
npm run build-v2 --no-hmr What am I doing wrong here? Also, any idea what is causing the underlying issue? It was working completely fine until my latest commit, where the only change that seems relevant is I added web accessible resources in the manifest. |
@clentfort Ah, were you only applying that to your |
@clentfort ooooh, you use For anyone reading this, this workaround does seem to work-- but this issue should remain open, as this is a hacky workaround and there's clearly a bug here. |
Ooph, the build size is significantly larger, I have a 12mb js file (I'm using react) when I use |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
This is probably related to #8071. |
i found that the code splitting feature might cause a bug because it worked after i edited a generated before (generate from parcel)
after (it works) 馃帀
|
@bonanaaaaaa I fall into the same issue and your workaround worked for me ! 馃帀 I also tried the last version of Parcel that fixed the problem but the final bundle is really bigger (content script is 1.1 Mo instead of 356 ko for the total size of the 3 content scripts) 馃槵 |
馃悰 bug report
I'm building a Web Extension with TypeScript + Parcel's Web Extension Config + React.
It was all working before, but I made some changes (notably adding web accessible resources), and now I'm unable to run the content script after loading a module from the
dist
produced byparcel build
, even thoughparcel watch
works.馃帥 Configuration (.babelrc, package.json, cli command)
馃 Expected Behavior
parcel build
on a manifest should product adist
that can be loaded as a Firefox (manifest v2) and Chrome (manifest v3) extension, where the content script successfully runs.馃槸 Current Behavior
parcel watch
produces a build that can be successfully loaded in Firefox. However, when I runparcel build
instead, the content script is failing to find a module.馃敠 Context
I previously uploaded the extension I built the Firefox Add-On store here. I am attempting a bug fix and a feature addition which would bump the version from
0.1
=>0.2
.I've loved working with this Web Extension config so far (this is the first time I've used Parcel), but I don't understand it quite that well yet. I have no idea what caused my previously working flow to break, except for potentially the addition of web accessible resources
馃捇 Code Sample
The full repo can be found here. The commit that introduced the bug, can be found here.
馃實 Your Environment
Questions
How can I get you more useful error messages? I don't know how to interpret the
Error: Cannot find module 'bJuUF'
in a useful way, i.e., figuring out what module that is or what part it's supposed to be loading.The text was updated successfully, but these errors were encountered: