cloudflare/vinext

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

Open

#1,449 opened on 2026年5月22日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)TypeScript (329 forks)github user discovery
adapter-api-e2ehelp wanted

Repository metrics

Stars
 (8,120 stars)
PR merge metrics
 (平均マージ 1d 1h) (30d で 462 merged PRs)

説明

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.

コントリビューターガイド