Skip to content

[Bug]: Next.js segments not accepting array #31523

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
masterjanic opened this issue May 20, 2025 · 0 comments · May be fixed by #31524
Open

[Bug]: Next.js segments not accepting array #31523

masterjanic opened this issue May 20, 2025 · 0 comments · May be fixed by #31524

Comments

@masterjanic
Copy link

Describe the bug

When using Next.js and rendering a dynamic route segment that accepts an array of paths, it is not possible to create a story with those segment parameters. Only strings are accepted. Thus any components using arrays in useParams can not be rendered.

However this is not the accepted behaviour since this is a commonly used Next.js feature.

There is no other way to pass an array or it is not mentioned in the documentation.

Reproduction link

https://stackblitz.com/edit/github-zr1szmtq?file=src%2Fstories%2Ftest.stories.tsx

Reproduction steps

  1. Run the story provided within the reproduction
  2. The error will appear showing that arrays are not working, the component can't be rendered

System

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (3) 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 <----- active
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-docs: ^9.0.0-rc.2 => 9.0.0-rc.2 
    @storybook/addon-onboarding: ^9.0.0-rc.2 => 9.0.0-rc.2 
    @storybook/nextjs: ^9.0.0-rc.2 => 9.0.0-rc.2 
    storybook: ^9.0.0-rc.2 => 9.0.0-rc.2

Additional context

No response

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

Successfully merging a pull request may close this issue.

1 participant