-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fails to detect nodeJS environment in the electron main process when using TypeScript and Webpack #70
Comments
Hi! Thank you for the notice! |
Hi! Electron has two process models, the main process (a NodeJS environment) and a renderer process (the browser/chromium environment that you are thinking about). This issue is for the main process, which is a NodeJS environment. The issue is not really caused by Electron directly, but by Webpack being unable to detect the dynamic require when generating the JavaScript bundles. Personally, I would not change anything in jzz or jazz-midi because so few people will run into this problem, I recommend just adding a small note in the READMEs for anyone using a JavaScript bundler (Webpack, Gulp, Babel, Browserify, etc.). Even this issue existing is enough, as someone will probably find it while they are troubleshooting. |
I made some Webpack fixes. Please check if that resolved your issue... |
Did it work? |
Only after I made the change to the webpack configuration. |
Is your project available online? I'd like to look what the problem was... |
When using jzz (and it's dependency jazz-midi) in an electron main process written in Typescript and transpiled with Webpack, a dynamic require found in JZZ.js does not work and the library fails to detect that it is in a NodeJS environment.
It is similar to the issue found at jazz-soft/jazz-midi#6
A workaround would be to apply the patch mentioned here as well as the following:
should be changed to
I'm not sure if typescript/webpack/electron issues are within the scope of this project, but I thought I would mention the fix I'm using.
The text was updated successfully, but these errors were encountered: