-
Notifications
You must be signed in to change notification settings - Fork 39
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
Storybook-Vite-Builder: requested module does not provide an export #50
Comments
Hey @MIreland thanks for opening this issue! I haven't really used this addon with vite so it would be incredibly helpful if you could provide a repro for it! Let me know and I'll try to figure out what's going on :) |
@yannbf, this may be related to the issue: mswjs/msw#670 I'm running the reproduction repo above and get the same error: Uncaught SyntaxError: The requested module './../node_modules/msw-storybook-addon/dist/mswDecorator.js' does not provide an export named 'initialize' When inspecting the published |
This looks like a bundler issue at first glance. The module is installed, it does export the things I'm importing in |
Vite, just like webpack 5, does not provide node polyfills. cf
|
This often happens for me the msw addon and vite builder but if I stop and start storybook it works again |
If you are using Vite: 4.3.9, and version 1.8 of this plugin for Storybook 7. I was able to get it to work by adding the following code to vite.config.ts import replace from '@rollup/plugin-replace'
export const config: UserConfigExport = {
plugins: [
replace({
'_globalThis$process.env.NODE_ENV': JSON.stringify('production'),
}),
react(),
// the rest |
@CurtisHumphrey, what you are describing looks like a fix for UpdateWe need to try to reproduce this with the latest version of everything. |
I'm attempting to use msw-storybook-addon with storybook-builder-vite, and running into the following error:
Any suggestions on how to resolve this?
I'll aim to get a code sandbox up if I get a chance
The text was updated successfully, but these errors were encountered: