-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Gatsby Version >= 2.0.24 breaks Storybook support #10662
Comments
Thank you for opening this @NathHorrigan Please add the following to
|
…k config (#10669) The steps in the current documentation for using Storybook with Gatsby (https://www.gatsbyjs.org/docs/visual-testing-with-storybook/) don't work because importing Link from gatsby in any component breaks. This is because several internals get required as a result of requiring anything from the default commonjs build (which would have been tree shaken before #9123) and eventually require a non-existent `pages.json`. More details are at #10668 This pull request updates the documentation with a quick fix (setting resolve.mainFields in the storybook webpack config override thereby _preferring_ es6 gatsby over commonjs) Fixes #10662
…k config (gatsbyjs#10669) The steps in the current documentation for using Storybook with Gatsby (https://www.gatsbyjs.org/docs/visual-testing-with-storybook/) don't work because importing Link from gatsby in any component breaks. This is because several internals get required as a result of requiring anything from the default commonjs build (which would have been tree shaken before gatsbyjs#9123) and eventually require a non-existent `pages.json`. More details are at gatsbyjs#10668 This pull request updates the documentation with a quick fix (setting resolve.mainFields in the storybook webpack config override thereby _preferring_ es6 gatsby over commonjs) Fixes gatsbyjs#10662
Hi, I am facing an issue on integrating storybook with gatsby.As my gatsby site consists of components which uses graphql queries which are giving an error.Is there any solution to create storybook for such components. footerSocialIcons Component Storybook for FooterSocialIcons Component import React from "react"; storiesOf("FooterSocialIcons", module).add( Error while creating the storybook for this component It appears like Gatsby is misconfigured. Gatsby related .Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby. Any solutions? |
I don't think this issue should be closed - it still persists in the latest versions of Gatsby (2.3) and Storybook (5.0), with the instructions in the Gatsby docs. This error happens anytime you try to include a component that uses
I don't think there's an easy solution to this one at the moment. |
Anyone have a recent update to this? |
I don't think this is strictly an issue with Gatsby, but a mismatch of context when Storybook is rendering components that expect the GraphQL data mesh for data fetching: storybookjs/frontpage#43 (comment)
|
Description
When following the gatsby docs for storybook support (https://www.gatsbyjs.org/docs/visual-testing-with-storybook/) on any version >= 2.0.24 you get the following fatal error:
Steps to reproduce
Expected result
Storybook should compile & serve
Actual result
Fatal Crash: See Above
Environment
The text was updated successfully, but these errors were encountered: