cloudflare/vinext

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

Open

#1 449 ouverte le 22 mai 2026

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)TypeScript (329 forks)github user discovery
adapter-api-e2ehelp wanted

Métriques du dépôt

Stars
 (8 120 stars)
Métriques de merge PR
 (Merge moyen 1j 1h) (462 PRs mergées en 30 j)

Description

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.

Guide contributeur