Skip to content

fix(next): allow typegen without active bundler#94954

Open
mturac wants to merge 1 commit into
vercel:canaryfrom
mturac:fix-94950-typegen-turbopack-rust-react-compiler
Open

fix(next): allow typegen without active bundler#94954
mturac wants to merge 1 commit into
vercel:canaryfrom
mturac:fix-94950-typegen-turbopack-rust-react-compiler

Conversation

@mturac

@mturac mturac commented Jun 18, 2026

Copy link
Copy Markdown

What?

Allows next typegen to load config without requiring an active bundler when bundler-specific experimental options are present.

Why?

next typegen does not run webpack or Turbopack, but it currently loads config through the production build phase. That makes experimental.turbopackRustReactCompiler fail unless TURBOPACK is set, even though type generation itself does not need a bundler.

How?

  • Marks the loadConfig call from next typegen as typegen-only while preserving the public PHASE_PRODUCTION_BUILD value passed to next.config.js.
  • Skips only the bundler-availability validation for next typegen; normal build/dev validation still runs.
  • Adds config unit coverage and an e2e regression fixture that verifies route types are generated.

Fixes #94950

Tests

  • pnpm jest packages/next/src/server/config.test.ts --runInBand
  • pnpm test-dev test/e2e/app-dir/typegen-turbopack-rust-react-compiler/typegen-turbopack-rust-react-compiler.test.ts
  • pnpm test-dev test/e2e/app-dir/typegen-error-diagnostic/typegen-error-diagnostic.test.ts
  • pnpm --filter=next build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

next typegen fails when experimental.turbopackRustReactCompiler is true

1 participant