-
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
Redux integration failed during build #2963
Comments
Are you missing the Normally when I see errors that only happen at build time, it's something to do with server side rendering. Things like code that expect |
Well, I don't have Where can I find the documentation about these |
Huh, I actually can't find any docs that specifically mention the In that redux example Gatsby uses this to render each of your pages to a string, then write those strings to plain HTML files. This only happens during Also in that example you've seen Does that help? |
Huh yeah — they do need better intros. The browser API docs neglect to say that these APIs are implemented in gatsby-browser.js |
@m-allanson That helps to shed a light. I've added
And my
After that, I got I think that has something to do with PropTypes, but I'm not sure since my project still works fine in |
Ran into this same issue yesterday when trying to integrate Redux based on this example. In
I've added
and
Both reference the
I think the only difference to the example is that I left out Anyone got an idea what might cause the hiccup? Here's a link to the whole repository, if that helps. |
@rppld the whole repo link helps a lot, thanks. It looks like you're running into #2005. I was able to get your build to run by removing the styled components plugin from @habibridho I'm not sure what your new error is, if you're able to create a minimal repo i can try and take a closer look. Based on the link in the error message, maybe something is not being imported correctly in your Template component? |
@m-allanson Ah dangggg!! In a previous approach I had already tried to remove all components that were using styled-components to see if this solves it, but to no avail. Removing the actual plugin like you suggested did the trick! Thanks a lot for this! |
I'm trying to create a minimal repo but I still could not reproduce the error (the project build well without error). I will try moving my components one by one in the morning and hopefully something will break and give us clue of what went wrong. I'll keep you posted. Thanks for the response anyway! |
It turns out that in my case, this lib cause the I think this is not gatsby's issue, so I'll close it. Thanks! |
Hi, I tried implementing gatsby and redux. I follow this example and it works in dev. However, when I try to build it, I got a webpack error:
WebpackError: Could not find "store" in either the context or props of "Connect(Template)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(Template)".
Here is my gatsby-browser.js
The text was updated successfully, but these errors were encountered: