`"zod": "*"` in `peerDependencies` resolves Zod 4, causing `import "@tscircuit/props"` to throw `z.function(...).args is not a function`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- build-system
Research direction
Start in package.json: compare the peerDependencies range for zod with the "zod": "3" in devDependencies, and with the ranges used by @tscircuit/circuit-json-util and @tscircuit/modelprinter. Confirm the failing call site is z.function().args(...) in lib/platformConfig.ts, then tighten the peer range to Zod 3 (issue suggests "3" or "^3.25.67"). Done means the repro script in the issue installs Zod 3 in a fresh directory and resistorProps.parse({ name: "R1", resistance: "10k" }) prints the parsed object; leave Zod 4 support to #752.
Written by the indexing model from the issue text.
Description
@tscircuit/props builds against "zod": "3" (devDependencies) and uses Zod 3's z.function().args(...) in lib/platformConfig.ts, which was removed in Zod 4, but package.json declares "zod": "*" in peerDependencies so npm installs [email protected] by default (and accepts an existing [email protected] without warning).
mkdir repro && cd repro
echo '{"type":"module"}' > package.json
npm install @tscircuit/[email protected]
node -e 'import { resistorProps } from "@tscircuit/props"; console.log(resistorProps.parse({ name: "R1", resistance: "10k" }))'
Actual (npm ls zod resolves [email protected] at the top level):
file:///.../repro/node_modules/@tscircuit/props/dist/index.js:20908
var pathToCircuitJsonFn = z191.function().args(z191.string()).returns(z191.promise(footprintLibraryResult)).or(
^
TypeError: z191.function(...).args is not a function
Expected: peerDependencies.zod is constrained to Zod 3 (for example "3" or "^3.25.67", matching @tscircuit/circuit-json-util and @tscircuit/modelprinter) until Zod 4 support (#752) lands, so npm install @tscircuit/props installs a compatible Zod 3 release and prints { name: 'R1', resistance: 10000 }.
Versions: @tscircuit/[email protected] (npm latest) and main (9068416c4), [email protected], Node.js v26.13.0, npm 11.20.0.
Credit: https://ucsbplse.github.io/
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 66
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 31
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
bug(core): JsonOutputKeyToolsParser ignores returnId: truePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/langchainjs#12239 ·
Maintainers usually reply within 1 day
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
paperclipai/paperclip#21837 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
code-yeongyu/senpi#6813 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 93/100
lingdojo/kana-dojo#34169 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100