andrews-quest's avatar

Vite: Error generating types

Hi, when building with Vite I get the following message:

error during build: [@laravel/vite-plugin-wayfinder] [plugin @laravel/vite-plugin-wayfinder] Error generating types: Error: Command failed: php artisan wayfinder:generate --with-form

And that's only at the dev server. When I try the same on the release, everything runs smooth.

I've tried comparing the composer.lock files on the remote and the dev, but they are identical as expected.

1 like
2 replies
andrews-quest's avatar

Alright, I've figured it out.

There was a syntax error in the code of one of my Controllers.

I realised that when I ran php artisan wayfinder:generate --with-form separately - it had printed the stack trace then.

1 like
faizH3's avatar

Hi, I'm also experiencing this issue. I built a project using React Starterkit. For now, I've added a comment in vite.config.ts:

Then run php artisan serve && npm run dev. This worked for me.

Please or to participate in this conversation.