From b3d7f988fae4b5b6af176df39284c30dfe91efdf Mon Sep 17 00:00:00 2001 From: Stefan Hildebrandt <695494+hildebrandttk@users.noreply.github.com> Date: Sun, 9 Aug 2026 22:38:46 +0200 Subject: [PATCH] fix(typecheck): regenerate route types and skip stale dev validator `npm run typecheck` failed with 8 TS2307 errors from Next's generated route validators referencing old page paths (e.g. calendar/page.js) after routes moved to catch-all segments. Two causes: - The production validator (.next/types) was stale. Prepend `next typegen` so `tsc` always runs against freshly generated route types. - The dev validator (.next/dev/types) is a turbopack-dev-only artifact that is absent from clean/CI checkouts and goes stale locally. `next typegen` force-re-adds it to tsconfig `include`, so exclude it instead (exclude overrides include), leaving route typing to the maintained .next/types. tsc still catches real type errors; verified `npm run typecheck` is clean and idempotent. --- package.json | 2 +- tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3bbcc2671..a2188656b 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test:translations": "vitest run --no-isolate lib/__tests__/translations.test.ts", "test:integration": "bash integration/run-tests.sh", "prepare": "husky", - "typecheck": "tsc --noEmit" + "typecheck": "next typegen && tsc --noEmit" }, "dependencies": { "@dnd-kit/core": "^6.3.1", diff --git a/tsconfig.json b/tsconfig.json index 74c5f7c8e..5c212ec31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,6 +39,7 @@ "node_modules", "repos", "examples", - "integration" + "integration", + ".next/dev/types" ] }