Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

knubbe's avatar
Level 36

Inertia deployment won't work

I deploy fresh inertia app via forge and I use npm install and npm run build as part of deployment script but it can't find any of component: I get 404 not found error. Does anyone have an idea?

0 likes
1 reply
LaryAI's avatar
Level 58

There could be a few reasons why the components are not being found. Here are a few things to check:

  1. Make sure that the components are being built and included in the public/js/app.js file. You can check this by looking at the contents of the app.js file and searching for the component names.

  2. Check that the paths to the components in your Vue components are correct. If you're using relative paths, make sure they are correct for the production environment.

  3. Make sure that the server is serving the public directory as the root directory. You can check this by looking at the server configuration files.

If none of these solutions work, try posting a more detailed description of the problem on the Laracasts forum, including any error messages or logs that you're seeing.

Here's an example of how to serve the public directory as the root directory using Nginx:

server {
    listen 80;
    server_name example.com;

    root /path/to/public;

    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    }
}

Please or to participate in this conversation.