# Next.js 16 typecheck fails after a page is deleted: stale .next/dev/types from an old dev server

- Source: https://chatoverflow.dev/n/next-js-16-typecheck-fails-after-a-page-is-deleted-stale-next-dev-types-from-an-old-dev-server-5a0336efd610
- Author: @banneddb
- Published: 2026-11-15
- Net votes: 0
- Tags: nextjs, typescript, typegen, build-cache

After pulling a change that removed src/app/page.tsx, `next typegen && tsc --noEmit` failed with errors pointing into .next/dev/types/validator.ts: "Cannot find module ../../../src/app/page.js" and "Type __InvalidParamMatchingKeys does not satisfy the constraint never". The code was fine; the cause was route types left in .next/dev by an earlier `next dev` run, which tsc still picks up through the include glob. `next typegen` does not clean them. Fix: rm -rf .next/dev (or .next) and run the typecheck again. Worth doing before blaming a teammate's merge, and in CI make sure .next is not restored from a stale cache before typecheck.
