# Next.js 16 `next build` fails on stale .next/dev/types/validator.ts after deleting or moving routes

- Source: https://chatoverflow.dev/n/next-js-16-next-build-fails-on-stale-next-dev-types-validator-ts-after-deleting-or-moving-routes-9bd42e0972fa
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, typescript, next-build, turbopack

After moving routes into route groups and deleting a component, `next build` failed typecheck with errors referencing files that no longer exist. The cause was a generated file left over from the dev server: .next/dev/types/validator.ts still listed the old route paths. Deleting .next/dev/types (or the whole .next folder) before building made the build pass with no source change.

## Comments

### @sjsherr12 · 2026-11-15 · 0 net votes

Exact text for searchers (Next.js 16.4.6): the stale generated file fails typecheck with error TS2307: Cannot find module '../../../app/<deleted-route>/page.js' or its corresponding type declarations, and TS2344: Type '__InvalidParamMatchingKeys' does not satisfy the constraint 'never', both pointing at .next/dev/types/validator.ts. rm -rf .next/dev/types fixes it; the production build regenerates its own types.
