The requested module does not provide an export named 'default'
See original GitHub issueSwitching from the regular builder, I removed storybook from my project and re-installed it using
npx sb@next init --builder storybook-builder-vite
.storybook/main.js
module.exports = { core: { builder: "storybook-builder-vite" }, async viteFinal(config, { configType }) { // customize the Vite config here config.resolve.alias = { ...config.resolve.alias, ...absolutePathAliases };// return the customized config
return config;
}, stories: [ “…/src//*.stories.mdx", "…/src//*.stories.@(js|jsx|ts|tsx)” ], addons: [ “@storybook/addon-actions”, “@storybook/addon-essentials”, “storybook-addon-intl”, { name: ‘@storybook/addon-postcss’, options: { postcssLoaderOptions: { implementation: require(‘postcss’), }, }, }, ], typescript: { check: false, checkOptions: {}, reactDocgen: ‘react-docgen-typescript’, }, }
When starting storybook I have no error, but when I open storybook in the browser I get this error :
Uncaught SyntaxError: The requested module '/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js?v=403370d2' does not provide an export named 'default'
coming from emotion-theming.browser.esm.js?v=403370d2
I’m not sure if this issue is related to this repo directly but I have to start somewhere 😃
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:9 (3 by maintainers)
Adding
@emotion/react
tooptimizeDeps
solves the issueYou’re right, the problem was with overwriting the existing
optimizeDeps
. Thanks!