Closed Axiol closed 4 months ago
I can't replicate the issue, cloned the project but it works as expected, the only thing I'm seeing is some hydration errors.
Just a few things to note:
BFF_URL
), which is required but there's no info on what it is and how to replicate it. I'd suggest to create repo/branch that just deals with dummy data, that way it wouldn't even be a requirement and it's just an install and run.laravel/sail
as a requirement, if you're running your app through Sail you'd need to run the Inertia SSR server within the Sail container, see https://laravel.com/docs/10.x/sail#executing-sail-commands. So you'd need to run sail artisan inertia:start-ssr
env()
within app code, you should only use that in config files. As per the warning here https://laravel.com/docs/10.x/configuration#configuration-caching the env()
helper will return null
in app code when config is cached.I pushed a commit with dummy data on the same branch as my link. So /en-continu
should work even without the env
But it is still the same. Just to be sure, what is the URL you visit after starting the project? I put http://localhost:13714/en-continu
as suggested by the prompt
You wouldn't visit the Inertia SSR server. You just visit your app as usual, Inertia then uses the SSR server to grab the rendered HTML and render it in the blade template
Oh. My bad then... Just to be sure, what need to be running at the same time? The app, the SSR server and the node server?
Oh. My bad then... Just to be sure, what need to be running at the same time? The app, the SSR server and the node server?
So just run your Laravel app like you always have, and then in production run php artisan inertia:start-ssr
, which will use Node in the background to do SSR. These days Forge has built-in support for this, which makes it really easy to get up and running.
As @RobertBoes suggested you don't ever visit the SSR node server, that's just a process running in the background that the Inertia Laravel communicates with it automatically 👍
Version:
@inertiajs/react
version: 1.0.15Describe the problem:
I created a new Laravel project and followed the steps to implement Inertia. Everything works fine. Then I tried implementing SSR. I followd the doc. But when I run
php artisan inertia:start-ssr
, I get a JSON responseSteps to reproduce:
Clone this project, install everything, run
npm run build
, and start withphp artisan inertia:start-ssr