Certainly! Here’s a detailed solution for your Laracasts forum question:
It looks like after updating to Inertia 3.0.2, the way SSR (Server Side Rendering) works has changed significantly: the SSR bundle is not auto-generated or placed where older versions might expect.
Why you're seeing this error
"Inertia SSR bundle not found. Set the correct Inertia SSR bundle path in your
inertia.ssr.bundleconfig."
This error means Laravel cannot find the SSR build file (the compiled JavaScript bundle for SSR rendering).
How to fix
1. Check the SSR path in config/inertia.php
In the new version, Inertia expects a built SSR bundle. Look at this line in your config/inertia.php:
'ssr' => [
'enabled' => env('INERTIA_SSR_ENABLED', false),
'url' => env('INERTIA_SSR_URL', 'http://127.0.0.1:13714'),
'bundle' => base_path('bootstrap/ssr/ssr.mjs'),
],
By default, the bundle path is bootstrap/ssr/ssr.mjs.
If you don't have this file, that's the problem.
2. Build the SSR bundle
If you use Vite for your Inertia/SSR, you need to run the Vite SSR build command:
npm run build:ssr
or, if you use Yarn
yarn build:ssr
Make sure your package.json has a script like:
"build:ssr": "vite build --ssr resources/js/ssr.js --outDir bootstrap/ssr"
If not, add it. The important part:
- Entry point must match your project (commonly
resources/js/ssr.js) - Output directory must match the one referenced in your config (
bootstrap/ssr/ssr.mjs).
3. Update your inertia config if needed
If you want to change where Vite builds the SSR file, update the inertia.ssr.bundle config accordingly.
4. Try to start SSR again
Now, re-run your command:
php artisan inertia:start-ssr
It should now find the SSR bundle and work as expected.
TLDR
You are missing your SSR bundle file.
Run:
npm run build:ssr
or
yarn build:ssr
and make sure the output file matches your config/inertia.php SSR bundle path.