-
Notifications
You must be signed in to change notification settings - Fork 30k
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
module: Fix bug for undefined CJS dependency loading from loader hook file #16381
Conversation
Would it be possible to get a CI run here? |
CI is currently locked because of the security release |
Thanks @targos, if that's clear now are we good to go? |
Ok, looks like all are passing except for one failure which seems CI-system-related. |
Would it be possible to merge this yet? |
Landed in d853758. Thanks! |
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Thanks so much for the quick merge @targos. |
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Assuming we shouldn't backport this to v6.x Please lmk if I am mistaken |
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where
import x from 'x'
would always returnx
asundefined
if the import was made in a loader hooks definition module.A parallel change to the CJS loading injection process which happens in https://github.com/nodejs/node/blob/master/lib/module.js#L521 meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
esmodules