-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split chunks are not being loaded in the webworker target #7879
Comments
Yes, splitting the initial chunks is (currently) not supported in WebWorkers. You must provide To get some kind of deduplication you could use |
I see, thanks @sokra! |
facing the same problem |
I am using
does seem to load the vendors chunk |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
. |
Any news on this? I have the exact same problem. But with node modules. The answer from @prateekbh does not fix it, I get the error
|
On my side, I'm using I hope initial chunks will be loaded properly soon ;-). If I can help, I would be glad to, but I have to admit I have no idea as to how to fix this. I looked a little in the codebase but it is hard to get to know it right now. |
I never had an anwer @dannibje 😛 |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
This is still a real issue even if it's inactive. I don't understand this bot. I never knew waiting issues out was a way to fix them ! 😛 |
will it support in webpack 5? |
So any way to import from a web worker my commons file?... |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
We can't fix everything. Piling up issues neither fixes them. But anyway this is fixed in webpack 5 |
…ation since it leads to a broken web worker bundle (webpack/webpack#7879)
* Automatically download the appropriate translation models, vocabularies and lexical shortlists if not already loaded * Configure bergamot models base url based on development build or not * Invalidate circle ci cache so that we can be sure that circle tests passes on a clean checkout and subsequent builds will have the bergamot-models already downloaded * Use typescript for the translation worker integration code as well * Only download model files if not already previously downloaded * Add notice in bergamot-translator-worker.ts about the contents being imported from elsewhere * Add some type declarations to translation worker * Move out model download code to separate function * Add license headers * Add simple in-browser test for model downloading * Add test that verifies that downloaded model files caching works * Add test that verifies that downloading model files for another language pair works * Replace cache.add with fetch+cache.put combo so that we have more control over what and when to cache downloaded model files * Add fetch progress callback, track total bytes transferred and measure the time it takes to download model files * Don't use third party lib for fetch progress callbacks + Ensure proper tracking of total bytes transferred * Serve model files gzipped from local http server * Handle missing language pair download errors gracefully * Verify the hash of downloaded model files * Invalidate circle ci cache * Exclude 'translation-worker' webpack target from split chunks optimization since it leads to a broken web worker bundle (webpack/webpack#7879) * Add file sizes to model registry (useful for tracking download progress) + Don't attempt to persist model files if remaining quota suggest that it won't work * Add a few additional sanity/error checks * Add in-browser test for failing download integrity checks * Cleanup model download code * Catch more load model errors * Pin bergamot-models revision so that the expected set of models are imported locally * Clean up import-bergamot-translator.sh * Restored translation for language pairs that re-use vocab files from the reverse direction * Cleanup and tweaks * Summarize periodical updates on total language pair download progress * Use more already available typings in translation-worker * Download progress hooked up through all abstraction layers and displayed as text in the translation infobar * Move translateAllFramesInTab to separate file * Some cleanup * Record model download time metric in post-translation telemetry * General cleanup and test improvements * Add model download time assertions in e2e tests
Bug report
What is the current behavior?
The chunks are not imported (no occurrences of importScripts in entry chunks) so an error is thrown:
If the current behavior is a bug, please provide the steps to reproduce.
Repo: https://github.com/Alexendoo/bugs/tree/master/02-webpack-worker-chunks
Hosted: https://alexendoo.github.io/bugs/02-webpack-worker-chunks/ (nothing to display, just the errors in console)
The above setup has two entries,
worker-a
andworker-b
that have a common shared dependency onshared.js
, it setsminSize: 0
andchunks: "initial"
insplitChunks
to force a separate chunk to be createdThe output of running webpack can be seen in
dist/
, neitherworker-a.js
norworker-b.js
importworker-a~worker-b.js
The bug also occurs when adding a named chunk to
cacheGroups
What is the expected behavior?
Both
worker-a.js
andworker-b.js
should import the chunk inworker-a~worker-b.js
, through importScripts or some other mechanismOther relevant information:
webpack version: 4.16.5
Node.js version: 10.7.0
Operating System: Windows 10
Additional tools: none
The text was updated successfully, but these errors were encountered: