Prefetch header with request /page-data//page-data.json giving 404
See original GitHub issueDescription
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…
<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:
- Created 4 years ago
- Reactions:3
- Comments:19 (5 by maintainers)
Top GitHub Comments
I am experiencing the same issue and looking for a solution that works
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.