-
Notifications
You must be signed in to change notification settings - Fork 62
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
whitelisted files may point to wrong node_modules #21
Comments
I'm facing the same problem. Is there any updates for this issue? |
This is still an issue it seems.. any fixes? |
Same here |
i'm seeing what appears to be this issue as well, but it was tricky to identify since everything was working fine locally, but failed when deployed to production. i thought it was an issue with being built on CI and then transferred to a different server. however, it instead appears that devDependencies were filling some gaps because I can reproduce the error locally by running |
This is really interesting; I've been adding We had this scenario:
Run
index.js const serverBundle = require('./dist/server.js');
serverBundle(); dist/server.js // webpack boilerplate etc.
// redux-toolkit module (whitelisted)
require('immer'); // Error: Cannot find module 'immer' (because this file does not live where the original |
I was recently bitten by this as well. I am also using I spent some time playing around with a fix. Basically, there needs to be another test added to the conditional here. We not only need to test if the requested module is on the The problem I ran into is that it's kind of hard to extract the parent module name from the Anyway, I tend to agree with @richardscarrott using |
say you whitelist module 'a', which has a dependency on module 'b'.
whitelisting a will pull it into the root directory, at which point
require('b')
statements ina
will start to fail because they now look in the wrong node_modules directory. whitelisted modules may need their require statements rewired to point to absolute paths, or at least new relative paths.Here's some similar code that I use to rewire require statements inside of a webpack externals function.
webpack.config.js
The text was updated successfully, but these errors were encountered: