Reproductible repository for an infinite preview reload when components contains dynamic import.
See storybookjs/storybook#28437
- In production mode, the Storybook preview has an infinite reload. See production for reproduction steps
- In development mode, the Storybook preview display an error
__webpack_require__.O is not a function
nvm use
npm install
To reproduce infinite preview reload in production mode
- Start terminal 1 with the command:
npm run build:webpack
- Start terminal 2 with the command:
npm run build:storybook
- Start terminal 3 with the command:
npm run start:server:app
- Start terminal 4 with the command:
npm run start:server:storybook
- Open http://127.0.0.1:3001 to view the Storybook public build
- The Storybook preview is infinitely reloading like the video above
To reproduce error in development mode
- Start terminal 1 with the command:
npm run start:webpack
- Start terminal 2 with the command:
npm run start:server:app
- Start terminal 3 with the command:
npm run start:storybook
- Open http://localhost:6006 to view the Storybook in development mode
- The Storybook preview display an error in the DevTools console like the image above
To test the component itself in standalone mode
- Start terminal 1 with the command:
npm run start:webpack
- Start terminal 2 with the command:
npm run start:server:app
- Open http://127.0.0.1:3000/demo to view the component itself in standalone mode
- The component preview is working correctly with the dynamic import