cloudflare/vinext

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

Open

#1449 aperta il 22 mag 2026

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (329 fork)github user discovery
adapter-api-e2ehelp wanted

Metriche repository

Star
 (8120 star)
Metriche merge PR
 (Merge medio 1g 1h) (462 PR mergiate in 30 g)

Descrizione

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.

Guida contributor