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
official next support #15159
Comments
Storybook + Next.js support is being actively studied, this work have to be done step by step however. Sadly, there is no magical/quickwin. We've tried to load the entire Next.js webpack config with the experimental Many Next.js boilerplate are also working on this subject, they are a good place to start to have at least a first working solution, and then experiment improvements (having a simpler config, supporting some things out of the box, improving mocks etc.), I am closing to avoid bloating the list of issues but feel free to keep the discussion going or to open issues on more specific points. Any input on Storybook + Next.js is more than welcome. |
Just a note on alternatives to Storybook specific to Next: I would have say "why not" a while ago, but with the recent advance in reusing Stories for testing, I think Storybook has a huge advantage over those technologies. If you just need stories, they are a good fit, if you want to enjoy Storybook vision of "holistic testing" and advanced frontend development, Next.js specific solutions will fall short. |
There is a discussion on the NextJs side: vercel/next.js#30628 |
Right now I am trying to integrate storybook and nextjs.
Although some claimed https://nextra.vercel.app/ would be "the better storybook for next" I would prefer storybook because of the ecosystem and the great community.
This issue has already been addressed in the Storybook FAQ:
https://storybook.js.org/docs/react/workflows/faq#how-do-i-setup-storybook-to-share-webpack-configuration-with-nextjs
In theory this approach will work however Next and Storybook provide solutions for the same topics which will negatively influence each other:
This issue has also been addressed in the Storybook Webpack Docs:
https://storybook.js.org/docs/react/configure/webpack#using-your-existing-config
Unfortunately that way we will lose the following Storybook features:
Describe the solution you'd like
As Next.JS has grown to a very important framework it would be cool to have official support for it.
Are you able to assist to bring the feature to reality?
yes - but I guess this will require a lot of know how of the storybook internals
Additional context
it is possible to get the entire Next.js Webpack Config with the following helper - maybe all it would take is to add the storybook
MDX
,React Code Gen
andSourceLoader
features to it:The text was updated successfully, but these errors were encountered: