Skip to content

1.0.3 breaks webpack build #129

Open
@lzilioli-prism

Description

@lzilioli-prism

The patch notes for 1.0.3 state 1.0.3 Change from cli-color to colors to reduce package size.

I am currently trying to upgrade my project from 1.0.0 to 1.0.6 and encountering the following error with my angular/webpack build:

./node_modules/colors/lib/system/supports-colors.js:28:9-22 - Error: Module not found: Error: Can't resolve 'os' in '/Users/lzilioli/Projects/prism-frontend/node_modules/colors/lib/system'

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 }

Is there a good way to resolve this? Arguably, the change in 1.0.3 should have come as a major version bump, since this change effectively breaks support for browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions