single-spa / single-spa-react

Single-spa lifecycles helper for React applications
https://single-spa.js.org/docs/ecosystem-react.html
MIT License
227 stars 63 forks source link

Cannot find module 'browserslist-config-single-spa' #133

Closed rafalmaciejewski closed 2 years ago

rafalmaciejewski commented 3 years ago

This error comes up when building webpack apps that include single-spa-react. It's thrown from babel-loader. It was introduced in 4.5.0 - 4.4.0 works fine. I think that to fix it browserslist-config-single-spa should be moved from devDependencies to dependencies.

ERROR in ./node_modules/single-spa-react/lib/esm/single-spa-react.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'browserslist-config-single-spa'
rafalmaciejewski commented 3 years ago

I fixed it by setting a rule to load single-spa-react with ignorebrowserslistconfig option in babel-loader config. So it occurs when loading node_modules with babel-loader for transpilation. I remember it was the default config in create-react-app so it may be worth to fix it here as well.

joeldenning commented 2 years ago

Thanks for reporting this, I've created #137 to fix this.

joeldenning commented 2 years ago

Fix released in https://github.com/single-spa/single-spa-react/releases/tag/v4.6.1