web3ui / web3uikit

Lightweight reusable Web3 UI components for dapps.

Home Page:https://web3uikit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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

  1. Download repo git clone git@github.com:web3ui/web3uikit.git
  2. Setup node version to v16.16.0
  3. Run pnpm install
  4. Run pnpm build
  5. 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.

image

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.

Related PR: #990

Thankyou @frankda 🥳
Closed as completed by #990