-
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
'default' is not exported by babel-runtime define-property.js #143
Comments
Oh man, I had problems with babel-runtime in the past as well. The only way I found to fix it in my case was to submit a pull request to a package to update their dependency to one that didn't use babel/runtime. Your app compiles/builds correctly in vite without storybook? Sorry I don't have a good answer, but it does indeed seem to be something funky that babel-runtime and/or core-js are doing that rollup doesn't like. |
@IanVS . |
Hi, I'm curious if we have any updates on that?
|
I finally find a workaround for this issue. I'm using
const { glob } = require('glob');
// we need to upgrade lingui to 3.x to remove the following config, they all come from lingui 2.x
const coreJsFiles = glob.sync('node_modules/core-js/modules/*.js').map(it => it.substring('node_modules/'.length));
const optimizeDeps = ['hoist-non-react-statics', ...coreJsFiles, '@lingui/core', '@lingui/react'];
viteFinal: async (config) => {
if (config.optimizeDeps) {
config.optimizeDeps.include.push(...optimizeDeps);
} else {
config.optimizeDeps = {
include: optimizeDeps
};
}
// remove the built-in mock-core-js
const plugins = config.plugins.filter((_, i) => i !== 1);
config.plugins = plugins;
// other configs
return config;
}, |
@ZeekoZhu worked for me. thanks! |
Thanks everyone. A fix for this has been released in |
Thanks @IanVS will try that soon |
trying to build storybook (i can watch storybook which is a milestone we achieved)
getting this error.
some of my components do actually load babel-runtime (like https://github.com/react-component/calendar and others). so I can't just bump to @babel/runtime. not sure even if it will help.
that's might related to how rollup bundles common js modules. but I'm not sure.
using the latest vite and storybook-builder-vite and storybook "6.4.0-beta.25"
The text was updated successfully, but these errors were encountered: