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

kanak09's avatar

Is Wayfinder using a cache for auto-generation ?

Hello, I am trying Wayfinder that looks pretty awesome. I could easily install it and generate file. I also added it in my vite config to generate on the fly but it seems there is an issue on my side because If i make some changes in method names, or even add new method the changes are not reflected on typescript side :

As you can see everytime I change a php file in my model/controller/route here is the vite log showing vite-plugin-wayfinder is executing.

I also tried to remove all the Wayfinder generated folders, execute wayfinder:generate All files are regenerated successfully but my changes are not taken. For example I changed a method name, or I changed a request type from POST to GET, and the ts file are same as first generation...

Did i miss something ? Thank you for help

0 likes
4 replies
kanak09's avatar

I just came with a solution. Using "php artisan route:clear" solve my problem. But as I saw in tutorial videos people are not using "php artisan route:clear" to auto generate typescript. So how can I autoclear route cache when having wayfinder ?

Snapey's avatar

one thing you should not be doing in development is route:cache. If you are, then stop.

kanak09's avatar

Thanks for your reply. My code is based on a fresh Laravel Starter kit project, so I didn't modify the settings and I don't even know how I could enable route:cache on dev. Do you have some hints please ?

orphanedrecord's avatar

@kanak09 Check the 17:21 mark in Jeffrey's Laravel Wayfinder Is The Way Larabit. You'll see in vite.config.js where he imports the "vite-plugin-run" to auto generate files.

Wayfinder is still in beta from what I understand and not part of the default starter kits just yet. The Wayfinder installation docs may have changed since the time of recording, but you may want to make sure you've set this up to auto-generate routes during builds or watching file changes (e.g. npm run build or npm run dev).

Please or to participate in this conversation.