Move zod to dependencies - #2
Merged
Merged
Conversation
server.ts imports zod at runtime (the rpcContract schemas are real zod objects), and bb plugin build bundles zod into dist/server.js rather than externalizing it. With zod listed as a devDependency, bb's git-plugin install does a production-only npm install (--omit=dev), so node_modules/zod is absent and the server bundle build fails: ERROR: Could not resolve "zod" Move zod to dependencies so production installs include it. Verified that node_modules/zod now exists after `npm install --omit=dev`, and that typecheck + 18 tests + bb plugin build all pass.
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.
Problem
A user installing from git hits a build failure:
Root cause
server.tsimportszodfor therpcContractschemas (lines 9–85), which are runtime zod objects, not type-only.bb plugin buildbundles zod intodist/server.js(it is marked// node_modules/zod/v4/classic/external.jsin the bundle) — zod is not externalized to bb's runtime.zodwas listed indevDependencies. bb's git-plugin install runs a production-onlynpm install --omit=dev, sonode_modules/zodis absent in the staging cache and esbuild cannot resolve the import.Fix
Move
zodfromdevDependenciestodependencies— it is a genuine runtime dependency of the server bundle.Verification
npm install --omit=dev→node_modules/zodnow present ✅ (this is the exact scenario that failed for the other user)npm run typecheck✅npm test✅ (18 tests, 3 files)npm run build(bb plugin build) ✅dist/server.jsstill bundles zod inline, so managed installs using the committed artifacts remain self-contained.Notes
dist/artifacts are unchanged by this move (zod was already bundled there), so no artifact commit is needed.package-lock.jsonalso drops somelibcfields — that's npm normalizing optional-dep metadata on this newer npm version; unrelated to the fix but harmless and kept.