[bugFix]Got error: "Failed to fetch dynamically imported module: http://localhost:6006/storybook/preview.jsx" for the first run
frankda opened this issue · comments
Describe the bug
Getting Failed to fetch dynamically imported module: http://localhost:6006/storybook/preview.jsx
when first time run pnpm storybook
. If restart storybook the error will be resolved automatically.
Reproduce
- Download repo
git clone git@github.com:web3ui/web3uikit.git
- Setup node version to
v16.16.0
- Run
pnpm install
- Run
pnpm build
- Run
pnpm storybook
Result
Storybook page will start after successfully built. And error Failed to fetch dynamically imported module: http://localhost:6006/storybook/preview.jsx
shows up.
System
Environment Info:
OS: Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020
Binaries:
Node: 16.16.0
pnpm: 7.14.0
Solution
According to the storyobok closed issue storybookjs/storybook#18641. It's because package msw-storybook-addon
is not pre-bundled for the first time of running pnpm storybook
. Can be resolved by adding it to optimizeDeps.include
to force it pre-bundled.