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

Furrukh's avatar

Unable to locate file in Vite manifest: resources/js/Pages/HomePage.jsx when running php artisan test

I am trying to write a simple test and I am seeing this error. I am using Laravel React stack

  • PHP 8.1.1
  • Laravel 10.17.1
  • React

my vite file

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';

export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.jsx',
            refresh: true,
        }),
        react(),
    ],
});
0 likes
7 replies
vincent15000's avatar
Level 63

I'm not familiar with React, but about the Vite manifest, have you run npm run build ?

Furrukh's avatar

@vincent15000 but the docs doesn't say to run npm run build before running the tests. Are we suppose to run this command before running the tests?

1 like
vincent15000's avatar

@Furrukh I really don't know, I run this command before putting the application in production.

1 like
Furrukh's avatar

@vincent15000 running the command did passed the test, I don't know if this is how its supposed to be, I am just learning, apologies if this was a stupid question to ask

1 like
vincent15000's avatar

@Furrukh No stupid question, only questions and answers. Happy to help.

If you are satisfied by the answer, please close the post by assigning a best answer.

2 likes
MohamedTammam's avatar

I think you need to change this resources/js/app.jsx to this resources/js/app.js

1 like
Furrukh's avatar

@MohamedTammam all my files are in jsx format, infact the default format that comes with breeze:install react is jsx. Though I still dont know the solution provided by @vincent15000 is the best or the only solution

1 like

Please or to participate in this conversation.