Hello, a few of my nodemodules/ dependencies are using modules that need polyfills, so webpack is throwing errors and my app won’t compile. How do we specify polyfills if Ionic React app does not provide a webpack file?
ERROR in ./node_modules/jws/lib/sign-stream.js 8:13-30
Module not found: Error: Can’t resolve ‘stream’ in ‘/Users/whitneypurdum/Documents/Eliarebeam/rebeam-monorepo/packages/client/node_modules/jws/lib’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “stream”: require.resolve(“stream-browserify”) }’
- install ‘stream-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “stream”: false }
1 post - 1 participant