{"record":{"id":"eb2e08ec16c676c3","repo":"vercel/next.js","slug":"experimental-usetypescriptcli-checks-the-complet","errorCode":null,"errorMessage":"`experimental.useTypeScriptCli` checks the complete TypeScript project; `--debug-build-paths` does not limit type checking.","messagePattern":"`experimental\\.useTypeScriptCli` checks the complete TypeScript project; `--debug-build-paths` does not limit type checking\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/verify-typescript-setup.ts","lineNumber":257,"sourceCode":"      strictRouteTypes\n    )\n    // Write out the necessary `next-env.d.ts` file to correctly register\n    // Next.js' types:\n    await writeAppTypeDeclarations({\n      baseDir: dir,\n      distDir,\n      imageImportsEnabled: !disableStaticImages,\n      hasPagesDir,\n      hasAppDir,\n      strictRouteTypes,\n      typedRoutes,\n    })\n\n    let result\n    if (shouldRunTypeCheck) {\n      if (useTypeScriptCli) {\n        if (debugBuildPaths) {\n          log.warn(\n            '`experimental.useTypeScriptCli` checks the complete TypeScript project; `--debug-build-paths` does not limit type checking.'\n          )\n        }\n\n        const { runTypeCheckCli } =\n          require('./typescript/runTypeCheckCli') as typeof import('./typescript/runTypeCheckCli')\n        result = await runTypeCheckCli({\n          baseDir: dir,\n          tsConfigPath: resolvedTsConfigPath,\n          tscPath: typeScriptPath,\n          cacheDir,\n          onFirstOutput: onFirstCliOutput,\n        })\n      } else {\n        const { runTypeCheck } =\n          require('./typescript/runTypeCheck') as typeof import('./typescript/runTypeCheck')\n        // Install native bindings so that code frame rendering works in the worker\n        const { installBindings } =","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/lib/verify-typescript-setup.ts#L239-L275","documentation":"Warning from verifyAndRunTypeScript when experimental.useTypeScriptCli is enabled and the --debug-build-paths flag was also passed. It clarifies that running tsc via the CLI always checks the complete TypeScript project, so the debug flag cannot narrow type checking to build-path files — the user's expectation about limiting the check is incorrect.","triggerScenarios":"Thrown at packages/next/src/lib/verify-typescript-setup.ts:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not combine `--debug-build-paths` with `experimental.useTypeScriptCli` expecting scoped type checks; the whole project is checked."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89d017eac43ebf4742ed2b58d3c1373b70283b69","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}