-
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
Breaks on latest gatsby, only when there is a webpack cache #131
Comments
Bypassed this issue by using webpack / Workers directly without this loader and RPC implementation. Feel free to investigate further or close this issue if you don't plan to have support for Gatsby out of the box 👍🏻 |
Getting this as well. The problem is the loader is not hitting the parser anymore - because there's nothing to parse thanks to the cache; and thus the export declaration hook that is meant to collect exported methods is no longer run. However, as the output of the loader is marked non-cachable, that part actually will rebuild every time. And ofcourse, after the first build it gets an empty array of collected methods. The solution here is, I think, to use the Webpack cache to cache the array of exported methods along with the modules. or to somehow mark the entry module of the worker as non-cacheable which forces it to always be processed from source, and always have the parser run. [EDIT] const exportNames = compilation.moduleGraph.getProvidedExports(entryModule); |
Running into the same issue with a recent version of create react app (v. 5.0.1). Had to disable the webpack cache as a workaround. Would be great if this could be taken care of on the library side |
yes same situation, when I cancel 的 webpack cache, it works fine. So how to make them coexist |
There's no way to hot-patch your way through it. |
It seems like after I start the Gatsby dev server a second time — and webpack has a cache — the worker doesn't load with the exported worker functions set on the object. The moment I clear webpack's cache and restart the dev server, the worker loads fine again.
Does this very limited description by any chance give you a quick insight about what might be causing this?
I'm afraid I can't really give more details, because the inner workings of gatsby/webpack is just one big black box to me.
I can of course make a minimal reproduction with a newly bootstrapped gatsby, if this would be of any help?
The text was updated successfully, but these errors were encountered: