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

NextJS, Vercel and Storybook don't work nicely together #15388

Closed
votemike opened this issue Jun 27, 2021 · 2 comments
Closed

NextJS, Vercel and Storybook don't work nicely together #15388

votemike opened this issue Jun 27, 2021 · 2 comments

Comments

@votemike
Copy link

Describe the bug
NextJS, Vercel and Storybook don't work nicely together when using the Next default of removing trailing slashes.
The problem is that Storybook expects a trailing slash in the URL, while Next removes trailing slashes by default. This can be flipped to require trailing slashes, but only for all URLs.
Another way around this is a custom route, but Vercel doesn't support custom routers.
While this isn't either Next's bug nor Storybook's, it'd be great if they could work together.

To Reproduce
git clone git@github.com:votemike/next-storybook-example.git && cd next-storybook-example && yarn install && yarn build-storybook && yarn dev
Then visit http://localhost:3000/styleguide and notice that Storybook does not load correctly.

System
Environment Info:

System:
OS: macOS 11.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Binaries:
Node: 14.16.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.12 - /usr/local/bin/npm
Browsers:
Chrome: 91.0.4472.114
Firefox: 70.0.1
Safari: 14.1.1
npmPackages:
@storybook/addon-actions: ^6.3.0 => 6.3.0
@storybook/addon-essentials: ^6.3.0 => 6.3.0
@storybook/addon-links: ^6.3.0 => 6.3.0
@storybook/react: ^6.3.0 => 6.3.0

Additional context
I think this could be fixed by allowing Storybook to be accessed on URLs without trailing slashes.
Maybe there is a better way.

@votemike
Copy link
Author

Same issue in Next: vercel/next.js#26651

@ndelangen
Copy link
Member

This is fixed in 7.0 beta

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