Skip to content

[Bug]: Storybook initialization hangs on loading screen with Next.js v15.3.2, Vitest, and styled-jsx module export error #31549

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

Open
satoukouga opened this issue May 22, 2025 · 3 comments

Comments

@satoukouga
Copy link

Describe the bug

When initializing Storybook in a Next.js v15.3.2 project using Vitest, the Storybook UI gets stuck on the loading screen and does not display component information. In the browser console, I see the following error:
Uncaught SyntaxError: The requested module '/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/styled-jsx/index.js?v=1422bc3a' does not provide an export named 'StyleRegistry'

Reproduction link

https://stackblitz.com/~/github.com/satoukouga/storybook-styledjsx-error?file=package.json&startScript=storybook

Reproduction steps

  1. Create a new Next.js project using pnpm dlx create-next-app@latest(15.3.2).
  2. Install Storybook by running pnpm create storybook@next(9.0.0-rc.4).
  3. Initialize Storybook as prompted.
  4. Start Storybook using pnpm storybook dev -p 6006.
  5. The Storybook UI remains on the loading screen and does not display component information.
  6. Check the browser console for the error:
    Uncaught SyntaxError: The requested module '/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/styled-jsx/index.js?v=1422bc3a' does not provide an export named 'StyleRegistry'

System

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm <----- active
npmPackages:
    @storybook/addon-a11y: 9.0.0-rc.4 => 9.0.0-rc.4 
    @storybook/addon-docs: 9.0.0-rc.4 => 9.0.0-rc.4 
    @storybook/addon-onboarding: 9.0.0-rc.4 => 9.0.0-rc.4 
    @storybook/addon-vitest: 9.0.0-rc.4 => 9.0.0-rc.4 
    @storybook/nextjs-vite: 9.0.0-rc.4 => 9.0.0-rc.4 
    eslint-plugin-storybook: 9.0.0-rc.4 => 9.0.0-rc.4 
    storybook: 9.0.0-rc.4 => 9.0.0-rc.4

Additional context

No response

@DaLukasDev
Copy link

I'm encountering the same issue in a Turborepo monorepo setup, also using pnpm (v10.11.0). However, adding styled-jsx as a direct dependency seems to have fixed the issue for me.

@souhailmerroun
Copy link

Same here

@souhailmerroun
Copy link

I have re-installed with just the minimal setup and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants