-
Notifications
You must be signed in to change notification settings - Fork 34
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
bug(gatsby-plugin-fastify): Error fetching page data for /using-ssr when pagePrefix is set #458
Comments
This fix seems incorrect to me...those assets should still be served from |
Yes, I did! I am using Include the Note: in fact |
The many problems with Okay, I'll try to find some time to look at this. From my current understanding your current solution shouldn't be correct, the assumption is...if you have a prefix, the non-prefixed path is probably an entirely different server and thus wouldn't be able to handle these routes. |
Okay, confirmed. I understand what's happening. |
Thank you for the confirmation! I agree with proceeding with "potentialPagePath". I plan to submit the Pull Request, but I'll do so after the Christmas holidays. I hope you have a wonderful holiday season with your loved ones as well. 🎄☃️ |
Deprecating Package. See: #495 for more info. |
The error happens when I use pathPrefix (e.g: /gatsby) in gatsby-config.js. I am serving SSR pages.
ERROR: Error processing /gatsby/page-data/using-ssr/page-data.json, Error fetching page data for /using-ssr: Page for "/gatsby/page-data/using-ssr/page-data.json" not found
To Reproduce
Steps to reproduce the behavior:
npx gatsby new gatsby-starter-rendering-modes
npm install gatsby-plugin-fastify fastify
plugins: [ { resolve: 'gatsby-plugin-fastify' }]
in gatsby-config.js,{ "scripts": { "start": "gserve" } }
in package.jsonnpm run start
A quick search in the gatsby-plugin-fastify code reveals me, the reason of the error.
Use
potentialPagePath
instead ofworkingURL
variable aspathName
param in thegetData
method.[Additionally to solve problem with trailingSlash]
Use
path
instead ofworkingURL
variable as param ofreverseFixedPagePath
method.Expected behavior
A quick change in the compiled code solves the problem.
Code line 56 is modified to use the variable
potentialPagePath
.[Additionally to solve problem with trailingSlash]
Code line 93 is modified to use the variable
path
.eureka!!!
System Info
After running the command:
yarn gatsby info --clipboard
in my project directorySystem:
OS: Windows 11 10.0.22621
CPU: (4) x64 Apple Silicon
Binaries:
Node: 19.9.0 - C:\Users\JHONNY
1\AppData\Local\Temp\xfs-fea441dd\node.CMD1\AppData\Local\Temp\xfs-fea441dd\yarn.CMDYarn: 4.0.2 - C:\Users\JHONNY
npm: 9.6.3 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.12.0
Browsers:
Edge: Chromium (119.0.2151.97)
npmPackages:
gatsby: 5.12.12 => 5.12.12
gatsby-plugin-alias-imports: 1.0.5 => 1.0.5
gatsby-plugin-fastify: 0.13.1 => 0.13.1
gatsby-plugin-federation: 2.5.0 => 2.5.0
gatsby-plugin-image: 3.12.3 => 3.12.3
gatsby-plugin-manifest: 5.12.3 => 5.12.3
gatsby-plugin-offline: 6.12.3 => 6.12.3
gatsby-plugin-preconnect: 1.4.0 => 1.4.0
gatsby-plugin-robots-txt: 1.8.0 => 1.8.0
gatsby-plugin-sharp: 5.12.3 => 5.12.3
gatsby-plugin-sitemap: 6.12.3 => 6.12.3
gatsby-plugin-styled-components: 6.12.0 => 6.12.0
gatsby-source-filesystem: 5.12.1 => 5.12.1
gatsby-transformer-sharp: 5.12.3 => 5.12.3
The text was updated successfully, but these errors were encountered: