Skip to content
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

[Bug]: useParams returns null in NextJS 14.2. Storybook 7 & 8 #26850

Closed
RickyRoller opened this issue Apr 15, 2024 · 2 comments · Fixed by #26874
Closed

[Bug]: useParams returns null in NextJS 14.2. Storybook 7 & 8 #26850

RickyRoller opened this issue Apr 15, 2024 · 2 comments · Fixed by #26874

Comments

@RickyRoller
Copy link

Describe the bug

When using the useParams hook in stories, an error will occur saying that the output of useParams is null.
This is happening with version 14.2 of NextJS and is possibly related to this PR which was included in the release vercel/next.js#60708

I've tried in both Storybook 7 and Storybook 8 and the bug is present in both.

To Reproduce

Here is a repo with an example https://github.com/RickyRoller/next-storybook-useparams
I forked another repo that was used for a similar issue.

System

System:
    OS: macOS 14.1.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm <----- active
  Browsers:
    Chrome: 123.0.6312.123
    Safari: 17.1
  npmPackages:
    @storybook/addon-essentials: ^8.0.2 => 8.0.2 
    @storybook/addon-interactions: ^8.0.2 => 8.0.2 
    @storybook/addon-links: ^8.0.2 => 8.0.2 
    @storybook/addon-onboarding: ^8.0.2 => 8.0.2 
    @storybook/blocks: ^8.0.2 => 8.0.2 
    @storybook/nextjs: ^8.0.2 => 8.0.2 
    @storybook/react: ^8.0.2 => 8.0.2 
    @storybook/test: ^8.0.2 => 8.0.2 
    eslint-plugin-storybook: ^0.8.0 => 0.8.0 
    storybook: ^8.0.2 => 8.0.2

Additional context

No response

@yannbf
Copy link
Member

yannbf commented Apr 18, 2024

Hey @RickyRoller thank you so much for reporting and your incredible description + repro. I'm on top of it, will get this soon in a patch release!

@RickyRoller
Copy link
Author

Hey @RickyRoller thank you so much for reporting and your incredible description + repro. I'm on top of it, will get this soon in a patch release!

Thank you! Much appreciated

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

Successfully merging a pull request may close this issue.

3 participants