mathewparet's avatar

Vite suddenly behaves odd!

I am on Laravel 12 and since the past few hours somehting has gone wrong with Vite and it behaves odd.

My local runs using Laravel Sail.

When I run sail npm run build first time, I get:

mathewparet@gMac mllm-concepts % sail npm run build

> build
> vite build

vite v6.2.0 building for production...
✓ 120 modules transformed.
public/build/manifest.json              0.20 kB │ gzip:  0.15 kB
public/build/assets/app-BQCMSuRn.css   68.33 kB │ gzip: 12.18 kB
public/build/assets/app-rX4knrQg.js   233.81 kB │ gzip: 80.86 kB
✓ built in 1.54s

And the second time I run the same, I get:

This pattern repeats every time. Every odd time I run it builds just 3 files while a subsequent run compiles it fully.

Also sail npm run dev doesn't work any more. It doesn't throw an error on the terminal but in the browser I can see:

Uncaught (in promise) Error: Page not found: ./pages/Dashboard.vue
    at resolvePageComponent (index.js:9:11)
    at resolve (app.ts:28:24)
    at r (createInertiaApp.ts:34:54)
    at L2 (createInertiaApp.ts:39:5)
    at app.ts:26:1Understand this error
chext_driver.js:495 

The above error doesn't occur if I run sail npm run build an even time. But appears if I run it an odd time.

This is quite odd! The only thing I've done different today is upgrading to Laravel 12.8 (from 12) and installing vue-awesome-paginator.

For the life of me I can't figure out what is wrong.

My vite.config.ts:

My package.json

My app.ts:

0 likes
0 replies

Please or to participate in this conversation.