-
-
Notifications
You must be signed in to change notification settings - Fork 167
Can't resolve node modules in Electron main process #203
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
Comments
Hey @yonigel, that's a pretty generic electron question you have and seems unrelated to threads.js. So I'm afraid this is the wrong place to ask. Code looks ok on first glance, though. Ask electron people on StackOverflow or so – they might be able to help you with that 😉 |
Solution in #211 is interesting but isn’t working so far; even after Webpack processed the module with dependencies (checking |
I am not sure I can follow. If you bundle the worker, then why do modules need to be resolved at runtime? I guess you are using webpack externals? |
No, did not have externals set up. Was getting “cannot find module” somehow when spawning a worker from string contents which had imported dependencies inlined by Webpack. This had been since resolved through using threads-plugin and instantiating threads’ Worker based on filename. It is not immediately intuitive what is happening behind the scenes, but ultimately we’ve got it working! 😄 |
So you tried first, but couldn't use the |
Yes, As it could have had something to do with Webpack behavior, I imagine it’d make sense to see if anyone else has issues with Here is an overview of experience, in case it’s useful in any way:
|
Hi,
I'm using Electron and I'm trying to use node module in the main process (i.e. path, fs), but getting following error:
For main window I'm using:
I saw this issue but it should work in electron main process as far as I understand.
Am I missing something?
Thanks
The text was updated successfully, but these errors were encountered: