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

TheDude's avatar

npm run build failing on local machine and server

npm run build

> build
> vite build

vite v3.2.4 building for production...
✓ 0 modules transformed.
Could not resolve entry module (resources/views/*.php).
error during build:
Error: Could not resolve entry module (resources/views/*.php).
    at error (file:///home/flesh/Desktop/This/src/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at ModuleLoader.loadEntryModule (file:///home/flesh/Desktop/This/src/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22175:20)
    at async Promise.all (index 1)

I ran npm install rollup, but it didnt help.

cat vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/js/app.js', 'resources/views/*.php'],
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,

This is occuring on my local machine and on the server.

0 likes
3 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Php isn't valid js and css. So vite cannot compile it

input: ['resources/js/app.js'],
1 like
TheDude's avatar

@Sinnbeck I suspected that. But I was thinking I'm quite sure my php files hot reload after an edit. Honestly I may be crazy.

Sinnbeck's avatar

@TheDude If you want to change what to what for reloading, it goes in reload: ['resources/views/*.php']

But it already has that folder by default

1 like

Please or to participate in this conversation.