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

aiMeta's avatar

Laravel 10 & Vite issue

Just created new project, added laravel ui with auth.

Ran: npm i then npm run dev

npm run dev

> dev 
> vite


  VITE v4.1.1  ready in 11369 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose  
  ➜  press h to show help

  LARAVEL v10.0.0  plugin v0.7.4

  ➜  APP_URL: http://localhost
The following dependencies are imported but could not be resolved:

  lodash (imported by C:/Lara Projects/base_auth/resources/js/bootstrap.js)

Are they installed?

what am i missing here... I see Laravel 10 now comes with Vite (not MIX) -- i have read the docs on Laravel site but no solution suggested.

Please help me

0 likes
17 replies
Sinnbeck's avatar

If you dont need lodash, simply remove it from C:/Lara Projects/base_auth/resources/js/bootstrap.js

Just delete that line and it should work :)

aiMeta's avatar

@Sinnbeck So Something like this... uncommented the 1st 2 lines

//import _ from 'lodash';
//window._ = _;

import 'bootstrap';

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

import axios from 'axios';
window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

aiMeta's avatar

Thank you for your prompt reply.

so should I just revert back to MIX?

Sinnbeck's avatar

@aifx4intel No need to? Vite is awesome and I would continue to use it if I were you. It just works a bit different. Instead of compiling files when running "dev" it just runs a dev server that pushes the asserts to the browser.

Is it stille not working or?

Sinnbeck's avatar

@aifx4intel The thing with vite is the speed. When using mix my app took 1-2 seconds to recompile on any change. With vite its instant and dont need to reload the page.

1 like
aiMeta's avatar

ok - if Vite is the way forward how do i resolve this out of the box issue..

when i click 'register' on laravel auth welcome page i get this:

Vite manifest not found at: C:\Lara Projects\base_auth\public\build/manifest.json

What i the bet way to resolve this keeping vite?

Sinnbeck's avatar

@aifx4intel That is for when you dont run the dev server. To make the file simple build for production with npm run build

Sinnbeck's avatar

Be aware that with mix, it compiles files with the dev command. Vite does not.. So when you want to do development be sure to run npm run dev

aiMeta's avatar

thanks. I hear you.... so how do i resolve this error to include Vite? I uncommented the lodash in resources/js/bootstrap.js

//import _ from 'lodash';
//window._ = _;

import 'bootstrap';

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

import axios from 'axios';
window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

yet when i try to register a user i get:

Vite manifest not found at: C:\Lara Projects\base_auth\public\build/manifest.json

when i run npm run dev as suggested it just hangs there...

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@aifx4intel Yes it "hangs" as its a server. Its like running php artisan serve. You leave it "hanging" while developing and hit "ctrl+c" when you are done for the day.

But to fix the manifest error you just run npm run build

2 likes
aiMeta's avatar

Ahhhh understood.

Thank you for your time.

Sinnbeck's avatar

@aifx4intel Happy to help :) I know its a bit confusing, but once you get it, its really great. You might want to end each day by running "npm run build" to compile the assets in case you forget to start the dev server the next time you want to work on pure php

aiMeta's avatar

@Sinnbeck so just to clarify...

npm run dev while busy with js /css or while building my app

and

npm run build is normally before deployment but at end of dev day if i didnt run the 1st cmd

Sinnbeck's avatar

@aifx4intel Exactly. But be aware that the /public/build folder is in .gitignore so if you plan to build locally and push the assets to production, be sure to remove it from there :) (if you use git)

1 like
yogeshgalav's avatar

It seems vite.php has been removed from Laravel 10, It used to come with Laravel 9 Will it create any issue if I manually paste the vite.php and use it?

Please or to participate in this conversation.