Skip to content

fix(config): make compiler.relay.src optional for Relay multi-project configs#95707

Open
Alexoswin wants to merge 1 commit into
vercel:canaryfrom
Alexoswin:fix/relay-multi-project-config
Open

fix(config): make compiler.relay.src optional for Relay multi-project configs#95707
Alexoswin wants to merge 1 commit into
vercel:canaryfrom
Alexoswin:fix/relay-multi-project-config

Conversation

@Alexoswin

@Alexoswin Alexoswin commented Jul 11, 2026

Copy link
Copy Markdown

What?

compiler.relay.src is currently required by Next.js's config schema, but
it's never actually consumed by the SWC/webpack relay transform or the
Turbopack relay transform — only artifactDirectory, language, and
eagerEsModules are used. This made it impossible to use Relay's official
multi-project config format (relay.config.js with a projects map),
which has no single top-level src, without adding an unused dummy value
just to satisfy validation.

Why?

Fixes #73097. Relay's multi-project mode is a supported, documented Relay
configuration shape (https://relay.dev/docs/guides/compiler-multi-project/),
so Next.js's config validation shouldn't require a field that the compiler
integration doesn't need.

How?

  • Made src optional in the compiler.relay Zod schema
    (packages/next/src/server/config-schema.ts) and the corresponding
    TypeScript type (packages/next/src/server/config-shared.ts).
  • Made the matching Rust struct field optional in the Turbopack relay
    transform (turbopack/crates/turbopack-ecmascript-plugins/src/transform/relay.rs),
    confirming src has no other read sites in that crate.
  • Updated the existing test/e2e/relay-graphql-swc-multi-project fixture
    to drop the now-unnecessary dummy src values, demonstrating the
    multi-project shape validates and builds without it.

Fixes #73097

… configs

The compiler.relay config schema required a `src` string even though
it is never read by the webpack/swc-loader or Turbopack relay
transforms (only artifactDirectory, language, and eagerEsModules are
consumed). This made it impossible to use Relay's multi-project
config format (relay.config.js with `projects`), which has no
top-level `src`, without supplying an unused dummy value just to pass
validation.

Fixes vercel#73097
@Alexoswin Alexoswin marked this pull request as ready for review July 12, 2026 08:17
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.

Relay multi-project configuration doesn't work

1 participant