-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cannot import built-in node modules in worker in electron/webpack build #10
Comments
It works with TypeScript, you just need to set The error above is unrelated to threads.js and the threads-plugin as far as I can tell. Try |
Feel free to re-open if I missed something. The error above looks very much like something else is fishy, though. |
@andywer // plugins: [new ThreadPlugin()], output:
|
Well, if you out-comment the threads-plugin, then webpack won't even know that it should process the worker script and its dependencies, so it won't crash as the worker's code isn't touched by webpack at all 😉 Have you installed the |
As shown above, |
Wow, that seems like a weird issue and requires more time to investigate then. |
@andywer Please review. Thank you. |
Can you please check if it's fixed in the latest version? #16 might have fixed it. |
I have encountered this issue.
this works for both main thread and renderer threads |
@raz-sinay Cool, thanks! @jc-lab Can you try and confirm that it works? If so, let's add a |
@andywer @jc-lab I've just discovered that you need to enable |
@pverscha Sure, but you shouldn't… 😅 One little XSS vulnerability in your webapp code and the attacker can take over your whole system at once ;) I wouldn't use (That little security insight is brought to you by someone building cryptocurrency wallets with Electron for a living, among other things ;) ) |
@andywer Thanks! Didn't think of that. |
I met the same problem and the |
@arition Hmm, are you using the latest version of the So if you set the webpack |
@andywer I think the problem still exists because the target is |
https://github.com/jc-lab/threads-plugin-problem
See the repository above.
Error when using module as esnext in tsconfig.
If you use commonjs instead of esnext, threads-plugin will not detect Worker.
The text was updated successfully, but these errors were encountered: