fix: resolve zod v4 peer dep conflict in @repo/payments via npm overrides#746
Open
mauriantolin wants to merge 1 commit intovercel:mainfrom
Open
fix: resolve zod v4 peer dep conflict in @repo/payments via npm overrides#746mauriantolin wants to merge 1 commit intovercel:mainfrom
mauriantolin wants to merge 1 commit intovercel:mainfrom
Conversation
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
Contributor
|
@mauriantolin is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #743
@repo/paymentsuseszod@^4.3.6, but@stripe/agent-toolkit@0.9.0pulls inopenai@4.xwhich declarespeerOptional zod@"^3.23.8". npm v7+ fails withERESOLVEeven for optional peer deps when an incompatible version is already installed — blockingnpx next-forge@latest initfor npm users.Root Cause
The dependency chain:
Fix
Added a targeted
overridesentry in the rootpackage.json(which already contains anoverridesblock forparse5):This tells npm's resolver to use
zod@^4.3.6when resolvingopenai's peer dep, eliminating theERESOLVEerror without disabling peer dep validation globally.Test plan
npx next-forge@latest initwith npm on Windows —npm installshould complete withoutERESOLVEerrorsbun installis unaffected (bun ignores npmoverrides)