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
navigate not working in gatsby build #10421
Comments
Webpack is failing to build this because You can fix this by moving the You can also do this declaratively in your render function by including the Redirect component from reach router I'm closing this for now since this issue isn't specific to Gatsby but feel free to reopen if there's anything else. |
User browser monads repo as a quick fix for this! |
Try wrapping the modules that want to access
IMO it's a bit of a nasty hack and it would be better if it's included in the |
I think this issue should be reopened for several reasons :
|
Any updates for this issue? |
After spending a day looking at this, I'm confused as to whether this error is generated by my actual code of the build tools themselves. As a framework for static sites, this is fundamental to the production side and to this date is unresolved imho. Agree with the above. I've inherited someone else' code to make text changes.... and have rebuilt this from scratch with a fresh build only to come to the same conclusion when running gatsby build. Please can we provide clearer guidelines as to where the culprit is if it's not in the page code. Is navigation.js generated by the build tools? if so, it'll be overwritten when tackling this again on next dev sprint surely? |
These are the reasons I find working with Gatsby so frustrating. The whole framework is riddled with such hard to catch bugs. Took me quite a while to figure out that there was nothing wrong with my code and it was Gatsby itself that was using the window object internally. Everything will be honky dory in the development mode but as soon as you try to build it, a bunch of cryptic errors are dumped on you. This bug was posted back in 2018 and they still havent fixed it. How hard would it have been for the Gatsby team to put the if-check fix in the code for navigate()? |
Description
I have a page,
/trial
, that I want to ensure is always visited with a route param. In my constructor, I checkthis.props.location.search
, and if it's falsy (empty) I want to navigate to/trial/?product=foobar
.Here's my code
Expectations vs Reality
This works fine during dev time, but when I run
gatsby build
I getEnvironment
The text was updated successfully, but these errors were encountered: