ozziexsh/laravel-jetstream-react

Add SSR support

Closed this issue · 8 comments

Would like to see Inertia SSR added.
I have tried to add it by myself but ran into some issues. #

oh cool I didn't realize SSR was released for inertia, I will look into adding this in the coming days 😄

oh cool I didn't realize SSR was released for inertia, I will look into adding this in the coming days 😄

Jetstream have also been updated to include SSR option 😁

@jonaspauleta I've got it working in #16 if you want to try it out early, otherwise i will release it in a day or so when i can triple test everything

@jonaspauleta I've got it working in #16 if you want to try it out early, otherwise i will release it in a day or so when i can triple test everything

I have tried it now.
Even without running 'node public/js/ssr.js' it works, idk if it is supposed to.

yeah it will return the non-ssr version as a fallback if you don't have that running :)

yeah it will return the non-ssr version as a fallback if you don't have that running :)

That's cool, but, how can I be sure that SSR is running fine in my machine?

make sure you have both the node process running and the laravel app being served

  1. there should be no errors in the node process window, it should just read

Starting SSR server on port 13714...
Inertia SSR server started.

if you navigate around pages it would log errors here if there were any

  1. visit a page directly and do your browsers "view source" function

if you have SSR enabled you will see the rendered html (these two screenshots are of the /register page)

Screen Shot 2022-04-21 at 7 36 57 AM
Screen Shot 2022-04-21 at 7 37 58 AM

versus this screenshot below which does not have SSR enabled so it is only a singe div being rendered (which inertia then boots into on the client side)

Screen Shot 2022-04-21 at 7 37 09 AM

Alright, thanks for your time and the explanation.
And thanks for making SSR available <3