fix(app): stop shadowing the repo pnpm lockfile on Vercel - #23
Merged
Conversation
The ripguard (EVM) Vercel project has rootDirectory=packages/app and no custom install command, so `pnpm install` runs inside packages/app. pnpm resolves its workspace root to the nearest pnpm-workspace.yaml, which was packages/app/pnpm-workspace.yaml -- so the repo-root pnpm-lock.yaml was never used and every dependency was re-resolved from its semver range at deploy time. That drift is what broke the build: fresh resolution now yields rainbowkit 2.2.11 -> @wagmi/connectors 6.2.0 -> @base-org/account 2.4.0 -> @coinbase/cdp-sdk 1.54.0, whose x402 module dynamically imports the @x402/* optional peer dependencies. They are legitimately absent, and Turbopack turns the unresolvable specifiers into build errors. The lockfile pins @coinbase/cdp-sdk 1.45.0, which has no such import, so CI and local builds stayed green. Removing the nested workspace marker lets pnpm find the root workspace and lockfile from packages/app, making the deploy reproducible and identical to CI. The ignoredBuiltDependencies it carried moves to the root pnpm-workspace.yaml. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Why
The
ripguard(EVM) Vercel project has been failing to build. The last green EVM production deploy was ~38 days ago — this predates the support-Telegram-link merge (PR #22) and is unrelated to it. The diffc005209..dcaaa9dtouched nopackage.jsonand nopnpm-lock.yaml.packages/app-solwas never affected, so sol.ripguard.xyz stayed green.The failure:
Root cause
The deploy was never using the committed lockfile.
The Vercel project is configured with
rootDirectory = packages/app, no custom install command, and include source files outside the root directory enabled — so Vercel runspnpm installinsidepackages/app. pnpm resolves its workspace root to the nearestpnpm-workspace.yamlwalking up from the cwd, andpackages/app/pnpm-workspace.yamlexisted (it carried twoignoredBuiltDependenciesentries). That madepackages/appits own workspace root, so the repo-rootpnpm-lock.yamlwas invisible and every dependency was re-resolved from its semver range on each deploy.That is why the break is latent and time-triggered rather than commit-triggered. Fresh resolution today walks
@rainbow-me/rainbowkit ^2.2.10→2.2.11→@wagmi/connectors 6.2.0→@base-org/account 2.4.0→@coinbase/cdp-sdk 1.54.0. That version's x402 module does:@x402/core,@x402/evm,@x402/svm,@x402/extensionsare declared optional peer dependencies ofcdp-sdk, so they are legitimately absent — but Turbopack statically analyses the dynamicimport()and turns each unresolvable specifier into a hard build error (8 of them). The committed lockfile pins@coinbase/cdp-sdk 1.45.0, which has no such import, which is why CI and local builds stayed green the whole time.The smoking gun in the failed deploy log is the store path:
./packages/app/node_modules/.pnpm/.... A workspace-root install puts the store at the repo root, not inside the package.Fix
Delete
packages/app/pnpm-workspace.yamland move itsignoredBuiltDependenciesto the rootpnpm-workspace.yaml.pnpm now walks up from
packages/appto the repo root, finds the workspace andpnpm-lock.yaml, and installs the pinned tree. Vercel setsCI=1, so pnpm additionally defaults to--frozen-lockfile. Production, CI, and local now resolve identically.Why not the alternatives
@x402/*packages. They are optional peers of a transitive dependency of a wallet connector RipGuard never invokes. It would pull a Coinbase payments SDK — including@x402/svmand its Solana stack — into the EVM app to satisfy an import that only exists to be caught and rethrown. It also leaves the deploy resolving fresh semver, so the next upstream release breaks prod again.@coinbase/cdp-sdkvia an override. Treats the symptom, freezes a transitive dep the app doesn't use, and still leaves every other transitive dep free to drift on deploy.serverExternalPackages/ a Turbopack alias. A bundler workaround for a dependency-resolution problem, and likewise leaves the build non-reproducible.Restoring lockfile-driven installs is the actual root cause and is strictly the smaller change.
Verification
Reproduced and fixed against Vercel's real command sequence, not CI's:
Module not found: Can't resolve '@x402/...', resolving@coinbase/cdp-sdk@1.54.0, store atpackages/app/node_modules/.pnpm.@coinbase/cdp-sdk@1.45.0, store at the repo root. Routes/,/create,/vaultsall compile.No connector regression: the client chunks still contain
walletConnect(11 files),injected(6),coinbaseWallet(5),metaMask(4),baseAccount(3), and RainbowKit.x402appears in 0 client chunks — it was only ever reached through the SSR pass of@base-org/account's node entry.Also green:
tsc --noEmit,lint,test(115 app / 168 app-sol), andpnpm --filter app-sol build— the rootpnpm-workspace.yamlchange does not disturb the Solana app.The Vercel preview deploy for this branch is green. The
Vercel – ripguardcheck on this PR built and deployed successfully — the same pipeline whose last production run (ripguard-6pu8nnjtz,main) is still sitting inERROR. All 6 PR checks pass:app,app-sol,Vercel – ripguard,Vercel – ripguard-sol,Vercel – ripguard-testnet,Vercel Preview Comments.I did not view the rendered page in a browser: the preview URL is behind Vercel deployment protection and I did not authenticate through it. The claim here is a green build and deploy, not a visual check of the running app.
Follow-up (not in this PR)
packages/app-sol/pnpm-workspace.yamlstill exists and carries the identical trap: sol.ripguard.xyz is also deploying from unpinned resolution and is one upstream release away from the same class of failure. It builds today, so I left it alone rather than touch a green deploy. Noted inAGENTS.md.🤖 Generated with Claude Code