Skip to content

fix: resolve zod v4 peer dep conflict in @repo/payments via npm overrides#746

Open
mauriantolin wants to merge 1 commit intovercel:mainfrom
mauriantolin:fix/payments-zod-npm-overrides
Open

fix: resolve zod v4 peer dep conflict in @repo/payments via npm overrides#746
mauriantolin wants to merge 1 commit intovercel:mainfrom
mauriantolin:fix/payments-zod-npm-overrides

Conversation

@mauriantolin
Copy link
Copy Markdown

Summary

Fixes #743

@repo/payments uses zod@^4.3.6, but @stripe/agent-toolkit@0.9.0 pulls in openai@4.x which declares peerOptional zod@"^3.23.8". npm v7+ fails with ERESOLVE even for optional peer deps when an incompatible version is already installed — blocking npx next-forge@latest init for npm users.

Root Cause

The dependency chain:

@repo/payments → @stripe/agent-toolkit@^0.9.0
                       → openai@^4.86.1 (peerOptional zod@"^3.23.8")
@repo/payments → zod@^4.3.6  ← conflicts with openai's peer dep range

Fix

Added a targeted overrides entry in the root package.json (which already contains an overrides block for parse5):

"overrides": {
  "parse5": "^7.2.1",
  "openai": {
    "zod": "^4.3.6"
  }
}

This tells npm's resolver to use zod@^4.3.6 when resolving openai's peer dep, eliminating the ERESOLVE error without disabling peer dep validation globally.

Test plan

  • Run npx next-forge@latest init with npm on Windows — npm install should complete without ERESOLVE errors
  • Verify bun install is unaffected (bun ignores npm overrides)

openai@4.x (a transitive dep via @stripe/agent-toolkit) declares
peerOptional zod@"^3.23.8", conflicting with zod@^4.3.6 in @repo/payments.
npm v7+ fails with ERESOLVE even for optional peer deps when an incompatible
version is already installed.

Using npm overrides to tell the resolver to use zod@^4.3.6 for openai,
instead of disabling peer dep checks globally with legacy-peer-deps.

Fixes vercel#743
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 3, 2026

@mauriantolin is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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-forge init fails with npm ERESOLVE due to zod version conflict in @repo/payments workspace

1 participant