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
nwjs require #1161
Comments
I would very much like to see this fixed as soon as possible since monkey patching my dependencies like this is driving me crazy
|
So I looked into it a bit and found a solution or rather temporal workaround since complexity of SystemJS goes way beyond my understanding. #1168 |
Unfortunately the System.set('@nwjs/module-x', System.newModule({ default: require('nwjs-module-x') });
global.require = undefined; Ideally the global require should not be set as that will interfere with global module evaluation. There is another change that may fix the global require issue here and that would be to move back to using a vm implementation that does encapsulated globals in Node. Perhaps that is the best fix really, I've created #1183 to track. |
I've added clearing the global scoped require in 8ee8916, pending release. |
Released in 0.19.25. |
Since we changed to no longer altering the
require
global during execution, this breaks Node webkit support as they use aglobal.require
there.We should always scope
require
to be undefined for SystemJS module execution, with synchronous reversion of the global value for AMD and global formats where we need to trigger the right UMD pattern.Then in terms of consistency, it's annoying that we have different rules for each format like this one, but it does seem best as that is the nature of handling compatibility cases.
The text was updated successfully, but these errors were encountered: