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

Heghiner9's avatar

After git init @vite is not working

Hi everybody! Before I added my project to git everything worked well, after git init @vite(['resources/sass/app.scss', 'resources/js/app.js']) is not working

vite.config.js import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import path from 'path'

export default defineConfig({ plugins: [ laravel([ 'resources/js/app.js', 'resources/sass/app.scss', ]), ], resolve: { alias: { '~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'), } }, });

0 likes
9 replies
lbecket's avatar

Try running npm install in your project's root directory to install all the required packages. Then run your build script again to see if it works.

Heghiner9's avatar

@lbecket Thank you for answer, I've tried it doesn't help, before adding project to git all packages were installed and everything worked well(

lbecket's avatar

Does it work again if you remove git (delete your .git directory)?

lbecket's avatar

Well, if you're only now attempting to add version control then I have to assume that you're in the very preliminary stages of this project. Perhaps it would be easiest to start from scratch, following the steps outlined in the documentation.

This might be less trouble than trying to identify the cause of this weird behavior.

1 like
Heghiner9's avatar

@lbecket Thank you! I tried npm run dev, npm run build, npm run watch and it worked)

Heghiner9's avatar

ohh, the only problem is that it's doesn't see images

Please or to participate in this conversation.