-
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
page.data.json 404 not found & componentDidMount() not firing in production #15322
Comments
Is your webserver setup to return JSON files? Someone on AWS found that their bucket wasn’t serving JSON files as |
@KyleAMathews This does seem very similar, I'll need to dig into Azure and Apache (haven't needed to do sysadmin in years) to determine how to have it served as |
@KyleAMathews WE HAVE LIFT OFF: https://gwhitworth-dev.azurewebsites.net/blog/2019/06/demo/ That was the issue! I may write this up since it seems more than I have hit this, mine was on Azure however. |
@KyleAMathews @gregwhitworth Could you please reopen this? I'm experiencing the same "page-data.json not found" errors, and I believe it only started after I've recently updated my npm packages. I don't seem to experience the misfired My site is hosted on Netlify, which is one of the major go-to platforms for gatsby sites. My site's repo is here and the site is here. |
@colbyfayock Looks like it; however, I'm not altering the |
Having the same error all of a sudden. Hosted on Netlify and data from NetlifyCMS. |
Also having this issue, hosted on Netlify. |
I'm also getting 404 for prefetch request /page-data//page-data.json . Not sure where is this double slash coming from, possibly something is missing between these 2 slashes.. |
I was experiencing a similar problem (deployed to Netlify), and for me it was caused by links to pages that didn't exist. I was working on a design and I had a temporarily link to an "Articles" page I had not yet implemented. Gatsby was attempting to be intelligent and prefetch this page, but it didn't exist, so I was receiving these errors. TLDR: Check to see if you are linking to any non-existent pages (any page that would 404) |
For anyone coming in via search results: I was experiencing the same issue, it tuns out on a previous version of the site, a service worked had been installed for offline support. At some point it was no longer being used, but the service worker was still registered in any browsers that had hit the url. I was able to resolve the issue by completely uninstalling it via these instructions: https://www.gatsbyjs.org/packages/gatsby-plugin-offline/#remove |
Hi @gregwhitworth! I'm having the same issue with azure. How did you fix it? What do i need to change? Thanks a lot |
@gregwhitworth @itesainnovation running into this as well still. |
For the benefit of @gregwhitworth and others who run into this on Azure app service and spend hour upon hour trying to figure out what's wrong with their Gatsby deployment that works perfectly on their local machine: Azure App Service, by default, doesn't have a proper mime type set up for JSON files. For Gatsbyjs, this will result in a bunch of errors, including 404 and page resources for / not found errors. The fix is simple. Create a web.config file in your static files. Put the following code into it:
Now build and deploy to Azure App Service. If your problem is the JSON mime type, this will fix it. You can check out this StackOverflow link for more info. |
Description
I couldn't find very much information regarding
page-data.json
but my site is currently hitting this where it 404's on finding any of these json files. The route is./page-data/<route>
. The only content I could find regarding this was this article introducing the breaking up of a larger manifest file.Steps to reproduce
Here is a demo page I created for this: https://gwhitworth-dev.azurewebsites.net/blog/2019/06/demo/
Things of note
Failed to load resource: the server responded with a status of 404 (Not Found) https://gwhitworth-dev.azurewebsites.net/page-data/blog/2019/06/demo/page-data.json
componentDidMount()
is not fired in production which it does locally, so ultimately I think this is the issue but have no idea if it's related to the page-data.jsonExpected result
The chart should render as it does locally
Actual result
If you open it you'll see that there is no highchart rendered although it does render locally
Environment
Also, I was hoping that issue #11524 would fix this issue but it doesn't unfortunately. Any help is appreciated.
The text was updated successfully, but these errors were encountered: