Can't resolve `fs` in cornerstone-wado-image-loader in 3.0.0
See original GitHub issueGetting this error when building my app.
ERROR in /Users/.../ProjectName/node_modules/cornerstone-wado-image-loader/dist/cornerstoneWADOImageLoader.min.js
Module not found: Error: Can't resolve 'fs' in '/Users/.../ProjectName/node_modules/cornerstone-wado-image-loader/dist'
I’m am using Next.js
which has a default webpack config. Luckily this issue can be resolved on my end by adding to following to the webpack config.
// next.config.js
export {
webpack(config) {
config.externals = { fs: 'commonjs fs' };
return config;
}
}
Can this be resolved in the package?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
cornerstonejs - Bountysource
ProjectName/node_modules/cornerstone-wado-image-loader/dist/cornerstoneWADOImageLoader.min.js Module not found: Error: Can't resolve 'fs' in '/Users/.
Read more >Module not found: Error: Can't resolve 'fs' in - Stack Overflow
The error is because of angular-cli does not support modules in node like "fs" and "path". (Issue). Add the following to the root...
Read more >module not found error can't resolve 'fs' in react js - You.com
From what I understand, the main issue seems to be that you can't call server-side (Node) methods in browser-interpreted client-side (front end) code....
Read more >Can't resolve fs - Help Requests - The Aurelia Discourse
node_modules/@babel/core/lib/transformation/normalize-file.js Module not found: Error: Can't resolve 'fs'. It all started when I added in lines trying to ...
Read more >[Gatsby, Storyblok] "Can't resolve 'fs' in x" - DEV Community
Hi there! I'm Arisa, a freelance Full Stack Developer living in Germany I'm developing Lilac, an... Tagged with gatsby,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to fix this by adding
node: { fs: 'empty' }
to my webpack config. Thanks for the tip guys.I started having a similar issue after updating to 3.0.0, it’s caused by some of the codecs requiring fs: charLS-FixedMemory-browser.js openJPEG-FixedMemory.js
fs may be used by their dependencies, I just noticed that those codecs had a require(“fs”) in the final bundle.