question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prefetch header with request /page-data//page-data.json giving 404

See original GitHub issue

Description

I’m getting 404 for prefetch request /page-data//page-data.json . This is server side generated prefetch header. Not sure where is this double slash coming from, possibly something is missing between these 2 slashes…

I’ve index.js inside src/pages/ folder.

These are the headers… see the prefetch header in second last line below…

gatsby-bug

<link as="script" rel="preload" href="/commons-2c9fa17bbfe249a3b2aa.js">
<link as="script" rel="preload" href="/app-ba96dfa6db2f113437ba.js">
<link as="script" rel="preload" href="/webpack-runtime-fe18612f865ab4668483.js">
<link as="fetch" rel="preload" href="/page-data/index/page-data.json" crossorigin="anonymous">
<link rel="prefetch" href="/page-data//page-data.json" crossorigin="anonymous" as="fetch">
<script charset="utf-8" src="/component---src-pages-404-js-618c1a666ce570d61585.js">

Environment

System: OS: Windows 10 CPU: (4) x64 Intel® Core™ i5-2400S CPU @ 2.50GHz Binaries: Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.7.0 - E:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.18362.329.0 npmPackages: gatsby: ^2.18.11 => 2.18.11 gatsby-plugin-manifest: ^2.2.26 => 2.2.30 gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18 gatsby-plugin-remove-generator: ^1.0.4 => 1.0.4 gatsby-plugin-robots-txt: ^1.5.0 => 1.5.0 gatsby-plugin-sass: ^2.1.20 => 2.1.24 gatsby-plugin-sitemap: ^2.2.24 => 2.2.24 gatsby-source-graphql: ^2.1.25 => 2.1.25

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
MauriceOppenbergercommented, Jan 8, 2020

I am experiencing the same issue and looking for a solution that works

5reactions
ygkncommented, Mar 16, 2020

This problem may be due to incorrect usage of Gatsby’s <Link> component: to use this component to in-route navigation.

If you use this component for external link, similar issue will occurs.

Use a tag for in-route navigation or external link.

For more information, check the Gatsby Link API documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby prefetch request /page-data//page-data.json giving 404
because Gatsby makes requests to those pages when you hover the <Link .../> (Check network tab in devtools). I've faced the same issue...
Read more >
404 error Header Request Too Long - Microsoft Community
Every time I click on a link i.e. "more," from the MSN Money/Investing pages, I get a "404 error Header Request Too Long....
Read more >
HTTP 404 Not Found calling REST from OSB using HTTPS
Say, the Host header. Or URL. Dump the conversation between OSB and the backend. Point OSB to Fiddler. Something is wrong with the...
Read more >
Handling 404 Errors > RESTful APIs in the Real World Course 1
Handling 404 Errors¶ We're handling validation errors and invalid JSON errors. ... be 404 And the "Content-Type" header should be "application/problem+json" ...
Read more >
X-DNS-Prefetch-Control - HTTP - MDN Web Docs
The X-DNS-Prefetch-Control HTTP response header controls DNS prefetching, a feature by which browsers proactively perform domain name ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found