-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Gatsby 5 SSG and SSR no content appearing on build #319
Comments
Oh shoot, I'm now seeing this, sorry for the delayed response @graemec23. I'm gonna try taking a look this weekend, thank you for raising the issue! |
This won't work in SSR - the examples with loading don't make sense in SSR context as the component will only get rendered on client-side either way. |
@jaszczw yeah, this was intentional and it worked fine on previous versions of Gatsby. I suppose the solution would be to make this library compatible with SSR by upgrading to React 18? |
But wrapping the whole app in return null means the server doesn't return anything - that's as far away from SSR as possible. |
@jaszczw yeah, I know what you are saying. I'm just not sure why this was working just fine for previous Gatsby versions and why it doesn't work now. I guess I'm asking for advice, I can't support SSR because use-shopping-cart is still on React version 17, SSR capabilities are only available on React 18, yeah? I've been so busy at work, I haven't been able to look at it 😭 |
I think the story is relevant here, so I am reporting it. (Translated at DeepL.) |
Hey @dsk52 I would love to fix it, I've just been too busy. I thought I addressed this in the most recent version. Can you share the behavior that's happening or is it the same thing as this issue? |
@dayhaysoos When I run Thank you very much for your time and maintenance. |
Okay thank you @dsk52 for that. I'm gonna try looking into this on the weekend. I really thought I addressed this but I guess I didn't. Thank you for bringing it up. If you can't wait, I'm open to PRs, I'll review much quicker. Let me know if you're interested in trying. Otherwise I'll do my best |
Thank you. |
No problem! Do you think I can reproduce this with a basic Next.js set up? I need to redo my examples because I don't have a more recent Next.js project with the new App Routes. I'll definitely have time this weekend tho, no worries! I'll report back to you 🫡 |
I think I'm ok with the basic setup. |
Okay thank you, will look into it 🫡 |
Just FYI @dsk52 I'm having some very unique troubles with Stripe right now so I'm not able to test. For context, they might have accidentally removed me from the ability to install Stripe SDKs from the npmjs registry. They are trying to help me figure it out, though. Sorry for the delay! |
Hey @dsk52, sorry this took so long. I just got access to the stripe SDks a few days ago. I just published an alpha that I hope fixes the SSR issue: https://www.npmjs.com/package/use-shopping-cart/v/3.2.0-alpha.0 if you do |
@dayhaysoos I tried running it on v3.2.0-alpha.0 right away. How about Gatsby? I don't have the environment at hand to reproduce it, but I hope it works. |
@dsk52 yes!!! I'm so happy it worked for you!! I have no idea about Gatsby, not sure when I can make time to test. If you ever decide to try it out would you let me know? |
I have a bug where If I use CartProvider, either in a Component or in Gatsby-ssr it will stop the HTML being rendered in Gatsby build. Removing the CartProvider fixes issue with content being shown. I have tried adding the CartProvider to gatsby-browser, however that breaks the build as it cant reference redux dispatch.
This is an example of Gatsby-ssr. Im using Gatsby 5, and use-shopping-cart version 3.1.6.
The text was updated successfully, but these errors were encountered: