Skip to content
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

Layout graphql query data not being passed down to 404 page #3504

Closed
baseten opened this issue Jan 12, 2018 · 4 comments · May be fixed by tejzpr/gatsby#61
Closed

Layout graphql query data not being passed down to 404 page #3504

baseten opened this issue Jan 12, 2018 · 4 comments · May be fixed by tejzpr/gatsby#61
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@baseten
Copy link

baseten commented Jan 12, 2018

Description

I have a graphql query in my layout, which is passing down data to all pages. The 404 page receives this data in development, but not in production.

Environment

Gatsby version: 1.9.52
Node.js version: 8.9.1
Operating System: Mac OS 10.11.6

Actual result

404 page not receiving layout graphql query data

Expected behavior

404 page should receive layout graphql query data as per other pages

Steps to reproduce

1. Add graphql query to src/layouts/index.js

2. Add src/pages/404.js component using data from this query

3. Run gatsby build followed by gatsby serve and navigate to non-existent page

@KyleAMathews
Copy link
Contributor

Yeah, looks like we're not passing props into the 404 page here

location: { pathname: `/404.html` },

Could you try adding ...props there and see if it fixes things for you? And if it does, PR the fix?

Check out the contribution instructions for setting up a local dev environment https://www.gatsbyjs.org/docs/how-to-contribute/#contributing

@nikolaik
Copy link
Contributor

I ran in to the same issue and adding ...props did not do the trick as suggested by @KyleAMathews. I'm not too familiar with the code base, but looking at the surrounding code it seems that layoutProps is not set for 404 pages, is it not rendered as a child of a layout?

@kakadiadarpan
Copy link
Contributor

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@kakadiadarpan kakadiadarpan added type: bug An issue or pull request relating to a bug in Gatsby stale? Issue that may be closed soon due to the original author not responding any more. labels Sep 27, 2018
@kakadiadarpan
Copy link
Contributor

This issue is being closed because there hasn't been any activity for at least 30 days. Feel free to open a new one if you still experience this problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants