-
Notifications
You must be signed in to change notification settings - Fork 86
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
Webpack 5 support #77
Comments
Just curious, would "Webpack 5 support" mean migrating the project from Webpack 4 to 5? |
@jbdoster it shouldn't require webpack 5, it's just a matter of checking for Webpack 5 when creating the child compiler's cache and using a |
I believe this can be solved by replacing this object with a Line 92 in 68ea667
if (compilation.cache) {
- if (!compilation.cache[subCache]) compilation.cache[subCache] = {};
+ let cache;
+ if (compilation.cache instanceof Map) {
+ cache = compilation.cache.get(subCache);
+ if (!cache) {
+ cache = new Map();
+ compilation.cache.set(subCache, cache);
+ }
+ }
+ else if (!compilation.cache[subCache]) {
+ cache = compilation.cache[subCache] = {};
+ }
- compilation.cache = compilation.cache[subCache];
+ compilation.cache = cache;
} If anyone wants to try that with Webpack 5 that'd be awesome. |
This comment has been minimized.
This comment has been minimized.
any progress here? |
Yea I'm seeing issues as well.
|
same issue as @jljorgenson18 ... will await the PR
|
This project seems to be death. Can anyone recommend a fork, which fix this issue and is still maintained? |
@jens-duttke DIY to write your own worker along with a wrapper : https://codeburst.io/promises-for-the-web-worker-9311b7831733 has example that i followed so that the WP v 5 upgrade could complete and the dependency on workerize-loader removed. Now worker-loader is all that is req'd for webpack 5 and my project |
@rowntreerob I use Beside that, my project is using Gatsby and there is only one Gatsby plugin right now for "Workers": |
There are 2 issues and ~3 PRs relating to this. |
Hi. Two major React frameworks, GatsbyJS and NextJS, have moved on to Webpack 5 with their latest major releases. Especially for Gatsby where there's no way to opt out of Webpack 5, this library has become a blocker for those who want to upgrade. It would be much appreciated if you could spend some time making this library compatible with Webpack 5. |
Facing the same thing out here, any solution yet? |
Hi. After struggling to find an alternative which supports webpack 5, I ended up writing my own simple library which allows me to interact with workers just as I would with workerize-loader, but is bundler independent. Now with a couple modifications to the worker, and using worker-loader to load it, I can keep using it just as before and get typescript support as an added bonus! I thought I'd share it as a gist in case it helps anyone. The code is tiny and single file so hopefully understanding and modifying it should be easy :D |
Haven't seen this reporter anywhere, tried out alpha 27 and with workerize-loader I get this:
The text was updated successfully, but these errors were encountered: