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

bug(gatsby-plugin-fastify): Doesn't work as expected for SSR pages #470

Closed
billypap1 opened this issue Feb 21, 2024 · 7 comments
Closed
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@billypap1
Copy link

Describe the bug

I use gatsby-plugin-fastify (v0.13.3) for my gatsby app (gatsby v5.13.3) but I have noticed 2 issues:

  1. When you navigate on a page which is SSR, it reloads the page, so it's losing state.
  2. In a page with ssr links, eg. a portfolio page with links to sub pages, I get this error:
    404 Not Found - http://localhost:8080/page-data/productID/page-data.json (On prefetch)

I tested the app with gatsby serve also, but I don't have any issue.

To Reproduce

Create a page with sublinks and check network page in Chrome.

Expected behavior

It shouldn't reload page and it should fetch page-data without any issue.

System Info

Please provide information about your site via these means as possible:

gatsby-plugin-fastify (v0.13.3)
gatsby v5.13.3

Commands to run:
yarn build
yarn gserve

@billypap1 billypap1 added the bug Something isn't working label Feb 21, 2024
@moonmeister
Copy link
Contributor

Hey @billypap1, thanks for the report. I don't have a lot of time to work on this. Anytime I do have will probably be working to replace this plugin with the new "adapter" spec Gatsby implemented. That'll fix a lot of these weird little issues.

I may have time the next couple days, I'll revisit that project and see what needs to be done. If you're interested in helping to get that across the line, let me know.

@moonmeister moonmeister added the wontfix This will not be worked on label Feb 21, 2024
@billypap1
Copy link
Author

Hi @moonmeister, ok.

For now, can I use gatsby serve in a docker for production?

According to the Gatsby docs:

"Server-Side Rendering requires a running NodeJS server. You can put NodeJS running gatsby serve behind a content delivery network (CDN) like Fastly*, however that also requires additional infrastructure (like monitoring, logging, and crash-recovery)."*

@moonmeister
Copy link
Contributor

Sounds like it'll work.

@char-cole
Copy link

hello @moonmeister, can you share the status of the fastify adapter? I'm currently trying to migrate a site to use SSR, and unsure if I should use this plugin, or help with the adapter, or roll my own setup (which, I don't really know know how to do tbh.)

it's also not clear from the docs if the adapter spec is mature enough for production without using netlify. any advice would be appreciated, as mentioned, I could also try to help with the adapter if that's the most reliable way to deploy going forward

@moonmeister
Copy link
Contributor

This is the PR: #449

Honestly it's been months...many months... So I don't remember the status. Adapters are what they are. The problem is netlify is putting in 0 effort to Gatsby or that spec and there are known issues they are not addressing. I'm sure we could get something working on Fastify, how well may be in question.

Because of Gatsby's slow death and my own personal life I'm putting almost no effort into any plugins. My honest recommendation would be to move to a new framework, but I recognize that's not always possible for folks. Spiritually I think Astro is probably the closest thing to Gatsby and Next is technically more familiar.

That said gatsby serve is better than it was when I started this project, though it probably has its issues like the rest of Gatsby. It may be adequate for production though I'll leave that up to you to decide.

If you're working for someone heavily invested in Gatsby who wants this adapter in top shape I'd be open to a contract to get this moving but otherwise I'll have little time for more than questions and PR reviews.

Hope this helps, let me know if you have any questions.

@char-cole
Copy link

Thanks very much for the advice. I guess my intuition that Gatsby seemed weirdly abandoned was in fact correct. I will take a look and see about migrating my project.

@moonmeister
Copy link
Contributor

Deprecating Package. See: #495 for more info.

@moonmeister moonmeister closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants