question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

corejs-upgrade-webpack-plugin causing problems

See original GitHub issue

Describe 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:

  1. Clone https://github.com/jdelStrother/corejs-demo (a create-react-app with storybook, and an import for fetch-mock)
  2. 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:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
Hypnosphicommented, Sep 27, 2019

Fun fact: this issue is the second link in Google for “corejs-upgrade-webpack-plugin”

2reactions
nemoDreamercommented, Apr 8, 2020

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…

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…:

ERR! EntryModuleNotFoundError: Entry module not found: Error: Cannot find module '/mnt/data/jenkins/workspace/ix-core-js-dist-conflicts/node_modules/@storybook/core/node_modules/html-webpack-plugin/lib/loader.js!/mnt/data/jenkins/workspace/ix-core-js-dist-conflicts/node_modules/@storybook/core/dist/server/templates/index.ejs'

🤦‍♂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found