Incompatibility when using with existing components (Error: 'default' is not exported by...)
See original GitHub issueI tried running our component library (using Storybook) with this, and got quite far!
start-storybook
is working perfectly fine, but when trying build-storybook
I’m not getting a successful build.
This is probably related to our setup / our components (a private Github repo, unfortunately), as the example (as per README
) is working completely fine for me.
The error in question is the following:
info @storybook/react v6.3.0-alpha.14
info
info => Cleaning outputDir: /home/julrich/Projects/Frontend/code/project/dist
info => Copying static files: ./legacy-instance => ./
info => Loading presets
info => Compiling manager..
vite v2.2.1 building for production...
transforming (1312) ../../@storybook/addon-essentials/node_modules/@storybook/components/dist/esm/controls/react-editable-json-tree/components/JsonArray.jsConflicting namespaces: node_modules/@storybook/client-api/dist/esm/index.js re-exports 'combineParameters' from both node_modules/@storybook/client-api/dist/esm/index.js and node_modules/@storybook/client-api/dist/esm/parameters.js (will be ignored)
transforming (1941) ../../lodash/_baseFindIndex.jsConflicting namespaces: node_modules/@storybook/addon-essentials/node_modules/@storybook/components/dist/esm/index.js re-exports 'components' from both node_modules/@storybook/addon-essentials/node_modules/@storybook/components/dist/esm/index.js and node_modules/@storybook/addon-essentials/node_modules/@storybook/components/dist/esm/typography/DocumentFormatting.js (will be ignored)
transforming (1987) ../../../packages/components/blog/lib/news-list/news-list.cssUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Error when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 1989 modules transformed.
'default' is not exported by /home/julrich/Projects/Frontend/code/project/node_modules/core-js-pure/features/object/get-own-property-symbols.js?commonjs-proxy, imported by node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js
file: /home/julrich/Projects/Frontend/code/project/node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js:2:7
1: import 'core-js-pure/features/object/get-own-property-symbols?commonjs-require';
2: import require$$0 from 'core-js-pure/features/object/get-own-property-symbols?commonjs-proxy';
^
3:
4: var getOwnPropertySymbols = require$$0;
ERR! Error: 'default' is not exported by /home/julrich/Projects/Frontend/code/project/node_modules/core-js-pure/features/object/get-own-property-symbols.js?commonjs-proxy, imported by node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js
ERR! at error (/home/julrich/Projects/Frontend/code/project/node_modules/rollup/dist/shared/rollup.js:5305:30)
ERR! at Module.error (/home/julrich/Projects/Frontend/code/project/node_modules/rollup/dist/shared/rollup.js:9750:16)
ERR! at Module.traceVariable (/home/julrich/Projects/Frontend/code/project/node_modules/rollup/dist/shared/rollup.js:10138:29)
ERR! at ModuleScope.findVariable (/home/julrich/Projects/Frontend/code/project/node_modules/rollup/dist/shared/rollup.js:8899:39)
ERR! at Identifier.bind (/home/julrich/Projects/Frontend/code/project/node_modules/rollup/dist/shared/rollup.js:4035:40)
Not sure what might cause this. Already tried debugging it with VSCode, and looking at the generated source. If these are features we’re utilizing in our components, I’d be happy to get rid of them / replace them. Just no real idea on where to start hunting!
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Error: 'default' is not exported by node_modules/conf/index.js ...
I've had to move to node 10 to find this problem and am currently on v10.18.1 . The easiest way to install it...
Read more >Rollup Error: 'default' is not exported by node_modules/react ...
Finally I found what was wrong. I needed the @rollup/plugin-replace plugin to replace process.env.NODE_ENV. Here's the working code.
Read more >TypeScript errors and how to fix them
When you are importing a module with built-in TypeScript declarations and TypeScript tells you that this module does not have a default export, ......
Read more >Building: Rollup - Open Web Components
Rollup configuration to help you get started building modern web applications. You write modern javascript using the latest browser features, rollup will ...
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
When importing CommonJS modules, the module.exports object is provided as the default export. Named exports may be available, provided by static analysis as...
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 Free
Top 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
My dependencies:
Storybook doesn’t use my vite config so no need to share it, right?
Sure, good to hear that you figured it out!