Appearance
date: 2026-06-16 tags: [wayfinder, vue, types-check, eslint, import-order, ci, generated-artifacts] status: active graduated_to:
Stale generated Wayfinder output fakes lint/type regressions — regenerate with --with-form before trusting either
Symptom — two false-regression shapes, both in files the current branch never touched:
npm run types:check(vue-tsc) fails across many auth/settings components withProperty 'form' does not exist on type '{ (options?…): RouteDefinition<"post">; … }'.npm run lint:checkfails withimport/ordererrors on@/routes/*imports (2026-07-03: a container built before the Labels sprint merged had noresources/js/routes/labels, so eslint classified the unresolvable module differently and demanded the opposite order). The trap compounds: runningeslint --fixin that state writes a genuinely wrong order that then fails once the routes exist — it produced a bad commit that had to be reverted.
Root cause — not a code regression: the generated Wayfinder output under resources/js/routes + resources/js/actions is gitignored, so a container serves whatever was last generated — missing new route modules entirely, and (via a plain php artisan wayfinder:generate) missing the .form variants the Vite plugin's formVariants: true normally emits. vue-tsc then errors on every xxx.form access, and eslint's import/order sorts an unresolvable @/routes/* module differently from a resolvable one.
Fix — regenerate with the flag: php artisan wayfinder:generate --with-form. (The Vite plugin already does this during npm run build/dev; the standalone artisan command does not unless you pass --with-form.)
Guard — .claude/hooks/session-start.sh now runs php artisan wayfinder:generate --with-form unconditionally, so a web container never starts on stale routes. Beyond that: when types:check or lint:check fails on route imports in files you didn't touch, suspect stale generated Wayfinder output before suspecting the code — and never run eslint --fix on import/order errors until routes are regenerated. The flag must mirror vite.config.ts's formVariants setting — if that config changes, the manual regen command changes with it.