-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] default is not exported issue #448
Comments
I had similar problems and after investigation I found that there's something wrong with mock-core-js rollup plugin. When I removed it the problem with 'default' imports has disappered. const { mergeConfig, loadEnv } = require("vite");
const path = require("path");
const config = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-storysource",
],
features: {
babelModeV7: true,
storyStoreV7: true,
},
framework: "@storybook/vue",
core: {
builder: "@storybook/builder-vite",
},
async viteFinal(config, options) {
const finalConfig = mergeConfig(config, {
define: {
'__APP_NAME__': JSON.stringify(process.env.npm_package_name),
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version),
'__APP_BUILT_AT__': JSON.stringify(new Date()),
"global": "global"
},
resolve: {
alias: {
"@": `${path.resolve(__dirname, "../src/lib")}`,
"@demo": `${path.resolve(__dirname, "../src/demo")}`,
"@story": `${path.resolve(__dirname, "../src/story")}`,
}
},
css: {
modules: {
localsConvention: "camelCaseOnly",
},
},
});
// TODO: This internal storybook vite plugin broke the build.
// It affects core-js and dependant packages imports (changes it to the empty string).
// Needs further investigation but for now we disable it.
finalConfig.plugins = finalConfig.plugins.filter(plugin => plugin.name !== "mock-core-js");
return finalConfig;
},
};
module.exports = config; |
@adiospl - That worked! Though I get out of memory errors now - but this seems like a Vite error not a SB error: vitejs/vite#2433 I was able to get around this by disabling sourcemaps for prod builds.
|
Thanks @adiospl that fixed it for me too! I've added a minimal reproduction here: https://github.com/mattmcardle/storybook-core-js-pure-bug This is created from the vite react-ts template, and then running I had to roll vite and the builder back to the latest 2.x and 0.1.41 versions respectively because of this issue |
Thanks everyone. A fix for this has been released in @mattmcardle the other issue you hit has been fixed as well, so you should be able to upgrade vite now. |
What version of
vite
are you using?3.0.1
System info and storybook versions
Describe the Bug
When I do
build-storybook
I get the following error:however in my app start/build and storybook start it works fine.
My
main.js
config looks like:it seems related to something storybook is doing internally but I can't seem to put my finger on it.
Link to Minimal Reproducible Example
No response
Participation
The text was updated successfully, but these errors were encountered: