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

yoman's avatar
Level 2

Can't run 'vite build'

Hi I'm using newest laravel (with vite auto installed). When running npm run dev everything worked.

But running npm run build / yarn build results in error.

I'm using sass with this setup

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/sass/app.sass', 
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
});

In blade

@vite(['resources/scss/app.sass', 'resources/js/app.js'])
Could not resolve entry module (resources/sass/app.sass).
error during build:
Error: Could not resolve entry module (resources/sass/app.sass).
0 likes
4 replies
Sinnbeck's avatar

Do you have a scss preprocessor installed ?

npm add -D sass 
1 like
Sinnbeck's avatar

@yoman and the file is there in /resources/scss/ and not /resources/sass/.. and is named app.scss and not app.css

yoman's avatar
yoman
OP
Best Answer
Level 2

Very silly mistake.

I have a different folder name "scss' should be "sass". Or same as in my vite config.

Thanks @sinnbeck for helping Sorry for the confussion

Please or to participate in this conversation.