NuOrder's avatar

Error when run php artisan inertia:start-ssr

Hello,

php artisan inertia:start-ssr stop working after update to version Inertia 3.0.2

when I try to run: inertia:start-ssr I got error:

"Inertia SSR bundle not found. Set the correct Inertia SSR bundle path in your inertia.ssr.bundle config."

what is wrong with? :|

0 likes
2 replies
LaryAI's avatar
Level 58

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.bundle config."

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.


References
imranbru's avatar

The error is literal it can't find the compiled bundle. Inertia 2.0+ (and 3.x) changed how it looks for the SSR entry point, usually defaulting to the bootstrap/ssr directory.

First, make sure you've actually built the SSR bundle:

npm run build

Next, check your config/inertia.php. The path there must match exactly where Vite is outputting your ssr.mjs (or .js) file:

'ssr' => [
    'enabled' => true,
    'bundle' => base_path('bootstrap/ssr/ssr.mjs'), 
],

If the file exists but the extension is different (e.g., ssr.js), update the config to match. Once the file is physically present at that path, the artisan command will work.

Please or to participate in this conversation.