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.

The requested module does not provide an export named 'default'

See original GitHub issue

Switching 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:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
JesusTheHuncommented, Jun 24, 2021

Adding @emotion/react to optimizeDeps solves the issue

1reaction
akbarikcommented, Feb 7, 2022

You’re right, the problem was with overwriting the existing optimizeDeps. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

42 - Stack Overflow
Uncaught SyntaxError: The requested module './add.js' does not provide an export named 'add' ; <head> ; <script type="module" src="app.js"> ; </ ...
Read more >
Requested module does not provide export named 'default'
The error "The requested module does not provide an export named 'default'" occurs when we try to import a value or a function...
Read more >
How to Solve does not provide an export named 'default'
To solve the error 'does not provide an export name default' in JavaScript, use the default keyword to make it the default export...
Read more >
Misleading error that module does not provide export #32137
SyntaxError: The requested module './dependency.cjs' is a CommonJS module, which can only provide a default export, not named exports, to an ES ...
Read more >
the requested module does not provide an export named
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
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