Skip to content
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

Incompatibilty with webpack 5 because of missing polyfills #127

Open
KKoukiou opened this issue Jan 31, 2023 · 0 comments
Open

Incompatibilty with webpack 5 because of missing polyfills #127

KKoukiou opened this issue Jan 31, 2023 · 0 comments

Comments

@KKoukiou
Copy link

Webpack 5 doesn't include polyfills for node.js

node-ip code uses os-browserify, and since it's brought as a dependency bundling fails with:

ERROR in ./node_modules/ip/lib/ip.js 3:11-24
Module not found: Error: Can't resolve 'os' in '/home/kkoukiou/repos/cockpit-machines/node_modules/ip/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: { "os": require.resolve("os-browserify/browser") }'
	- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "os": false }

webpack compiled with 1 error

The workaround is fine, but would be nice that this would be solved on this module directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant