corejs-upgrade-webpack-plugin causing problems
See original GitHub issueDescribe the bug If you import fetch-mock (which relies on core-js v2), its core-js imports fail. If I hack storybook to remove the corejs-upgrade-webpack-plugin, everything seems to work fine.
Sample errors:
ERROR in ./node_modules/fetch-mock/es5/client.js
Module not found: Error: Cannot find module 'core-js/modules/es6.regexp.replace'
@ ./node_modules/fetch-mock/es5/client.js 115:0-45
@ ./src/stories/index.js
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js ./node_modules/webpack-hot-middleware/client.js?reload=true
To Reproduce Steps to reproduce the behavior:
- Clone https://github.com/jdelStrother/corejs-demo (a create-react-app with storybook, and an import for fetch-mock)
- Run
yarn storybook
Expected behavior Storybook successfully builds
System:
- OS: MacOS 10.14.5
- Device: Macbook Pro 2016
- Version: 5.1.9
Additional context Fun fact: Naming your project “core-js-demo” is also a great way to break your storybook build since it matches the /core-js/ regexp that the plugin uses…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Upgrade to Webpack 5 failing - node.js - Stack Overflow
I am attempting upgrade to Webpack 4 to Webpack 5. ... https://github.com/facebookincubator/create-react-app/issues/343. context: __dirname ...
Read more >corejs-upgrade-webpack-plugin - npm
a webpack plugin that transforms core-js v2 paths to core-js v3 paths. Latest version: 4.0.1, last published: 2 years ago.
Read more >To v5 from v4 - webpack
Upgrade webpack 4 and its plugins/loaders · Make sure your build has no errors or warnings · Make sure to use mode ·...
Read more >corejs-upgrade-webpack-plugin - npm package | Snyk
Learn more about corejs-upgrade-webpack-plugin: package health score, popularity, security, maintenance, versions and more.
Read more >How to polyfill node core modules in webpack 5 - Alchemy
Because the current version of webpack no longer includes NodeJS polyfills by default, it is causing issues for developers that use create-react ...
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
Fun fact: this issue is the second link in Google for “corejs-upgrade-webpack-plugin”
OMG… This error was only happening on CI, and has been taking up most of my time these past 2 days…
My branch was called
issue/SG-16714-fix-core-js-dist-conflicts
, which on CI gets baked into the workspace path…:🤦♂