cloudflare/vinext

Build failure: custom `typescript.tsconfigPath` from `next.config` not honored

Open

#1,449 创建于 2026年5月22日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)TypeScript (329 fork)github user discovery
adapter-api-e2ehelp wanted

仓库指标

Star
 (8,120 star)
PR 合并指标
 (平均合并 1天 1小时) (30 天内合并 462 个 PR)

描述

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).

Problem

When next.config.js specifies a non-default typescript.tsconfigPath, the vinext production build fails entirely with Custom deploy script failed: undefined (1). The build pipeline appears to assume the default tsconfig.json and does not forward the user-specified path to the TypeScript / Vite compiler. Affects App Router, Pages Router, and middleware variants of the test fixture.

Error: Custom deploy script failed:  undefined (1)
    at NextDeployInstance.deployUsingCustomScript

Estimated Impact

~6 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/tsconfig-path/index.test.ts (3 failures)
  • test/e2e/typescript-custom-tsconfig/test/index.test.ts (3 failures)

Recommendation

  1. Reproduce first in vinext's own test suite. Add a test fixture with tsconfig.app.json and typescript: { tsconfigPath: './tsconfig.app.json' } in next.config.js. Confirm the build currently fails.

  2. Study how Next.js loads the typescript config. Search .nextjs-ref/packages/next/src/build/ for tsconfigPath to understand the resolution order and what the path is used for (paths, baseUrl, JSX runtime).

  3. Forward the custom path to Vite/Rolldown. Read typescript.tsconfigPath from the resolved next config and pass it as the tsconfig option to Vite's TypeScript handling (or load the file and merge its compilerOptions.paths/baseUrl into the Vite resolve options).

  4. Check dev/prod parity. Apply the same resolution in both server/dev-server.ts and the production build.

贡献者指南