-
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
How to show location in components on 404 page in production build #10689
Comments
I ended up just putting the whole form in JSX, and using netlify to let users submit it, so I'm fine. I think this is still kind of a confusing footgun, though, because it works in dev mode, but then fails in production. |
Hey @isaacs Apologies for the confusion. I reverted back to isaacs/blog.izs.me@10f76d6 to try to reproduce this and was able to.
Anyway, what's odd is that the link renders as broken even though React passes in the right value |
@isaacs Spend some more time debugging this with @pieh It seems to be a hydration issue with ReactDOM From https://reactjs.org/docs/react-dom.html#hydrate
The anchor tag's href attribute is Moving it to plain text like return |
I see, so because it's in an attribute, it won't be patched. Yeah, it seems like I could potentially do some client-side stuff, like We can close this, thanks for answering my question. Bummer that there isn't a straightforward way to make this work, but I suppose Gatsby can't pre-render every possible path that would show the 404 page, that's kind of the point :) |
Hey @sidharthachatterjee do you know if this issue is now resolved in version 2.13 of gatsby? Thank you! |
Having trouble as well to capture |
I am able to get Error on Netlify: |
Summary
I'd like to put a contact form and twitter link on that page so that people can tell me if they find something busted.
I'm having some trouble getting the location to show on my production-built 404 page. It works in dev mode, but in production, the "location" that gets rendered is either
undefined
or/404.html
.What's weird is that
<pre>
tag does render it (albeit after initial load), but passing it to the Post and TwitterLink components just gets either "undefined" or "/404.html"Here's the 404.js: https://github.com/isaacs/blog.izs.me/blob/d4355915f7c8be78f1653fde6ede302ff022ba68/src/pages/404.js
Rendered example: https://blog.izs.me/blargggggggasefasf
This one renders as "undefined": https://github.com/isaacs/blog.izs.me/blob/d4355915f7c8be78f1653fde6ede302ff022ba68/src/pages/404.js#L23
This one renders as "/404.html" https://github.com/isaacs/blog.izs.me/blob/d4355915f7c8be78f1653fde6ede302ff022ba68/src/pages/404.js#L29
And this one shows the full object: https://github.com/isaacs/blog.izs.me/blob/d4355915f7c8be78f1653fde6ede302ff022ba68/src/pages/404.js#L32
Thanks for any help or pointers you can provide.
The text was updated successfully, but these errors were encountered: