-
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 stat cache keeps broken results in cache #26926
Comments
/cc @BridgeAR |
Node v11.11.0 introduced a bug where re-requiring a file which previously did not exist won't resolve to that file. Therefore we switch to the async-node target of Webpack for our server- side build which uses the vm and fs modules to load chunks, so that we don't run into the above mentioned bug. Read more: nodejs/node#26926
Node v11.11.0 introduced a bug where re-requiring a file which previously did not exist won't resolve to that file. Therefore we switch to the async-node target of Webpack for our server- side build which uses the vm and fs modules to load chunks, so that we don't run into the above mentioned bug. Read more: nodejs/node#26926
Node v11.11.0 introduced a bug where re-requiring a file which previously did not exist won't resolve to that file. Therefore we switch to the async-node target of Webpack for our server- side build which uses the vm and fs modules to load chunks, so that we don't run into the above mentioned bug. Read more: nodejs/node#26926
Yes, facing the exact same issue. Discovered while I was writing some tests |
not works for paths cache (node_modules) test case
Actual behavior:
Expected behavior: |
@lwr your issue is unrelated to the issue originally mentioned. I am not certain if your example ever used to work. I tried almost all Node.js versions down to v6.17.1 and all threw the |
@BridgeAR I am sorry for something wrong in the test case one line added to the test try { require('anything-needs-lookup'); } catch (e) {}
+ require('./any-related-js'); and the test command changed to rm -rf node_modules && echo '' > any-related-js.js && node 1 the test is passed in 10.17.0 / failed in 13.6.0 |
nodejs under v15.5.1 has a bug: it will cache MODULE_NOT_FOUND when require a non-exits file([issue](nodejs/node#26926)). ./debug.js try to require('debug'), if the 'debug' pkg not exits, nodejs will cache the result. Even install debug later in the same process(spawn npm install), require('debug') will still throw error so, we should make 'debug' pacakge as dependencies.
nodejs between v11.x - v15.5.1 has a bug: it will cache MODULE_NOT_FOUND when require a non-exits file([issue](nodejs/node#26926)). ./debug.js try to require('debug'), if the 'debug' pkg not exits, nodejs will cache the result. Even install debug later in the same process(spawn npm install), require('debug') will still throw error so, we should make 'debug' pacakge as dependencies.
Actual behavior:
require
ing a non-existing file throws aMODULE_NOT_FOUND
error, creating the file afterwards and trying torequire
again still throws.Expected behavior:
The second call to
require
should resolve to the actual file content.Try the following three lines in a REPL (Node v11.10.1 vs Node v11.11.0):
It seems like the bug was introduced with this commit: d94f4c23fe - I built Node.js with this commit and with its parent commit and was able to observe the above mentioned behavior.
The text was updated successfully, but these errors were encountered: