Skip to main content
← Back to list
01Issue
BugClosedSwamp Club
AssigneesNone

Extension Zod schema incompatibility after upgrade to 20260312

Opened by swampadmin · 10/23/2025

Description

After upgrading from 20260210.15326.0 to 20260312.232506.0, all extension model operations (model create, model get) fail with:

Cannot read properties of undefined (reading '_zod')

Stack trace points to to-json-schema.js inside swamp's compiled Zod 4.3.6 trying to process schemas created by the extension's npm:zod@4 import.

Root Cause

The swamp binary has Zod 4.3.6 compiled in (via deno compile). Extension bundles import npm:zod@4 which Deno resolves to a separate npm-cached copy. Even when both are 4.3.6, they're different module instances, so internal _zod property lookups fail when swamp's toJSONSchema() introspects extension-created schemas.

Reproduction

  1. swamp repo upgrade to 20260312
  2. swamp extension pull @dougschaefer/cisco-collaboration-endpoints
  3. swamp model create @dougschaefer/cisco-collaboration-endpoints-device test-device --json

Fails with the _zod error. Same extension works on 20260210.

Workaround Needed

Extensions built with the old swamp binary (pre-upgrade bundles) still work. Only extensions whose bundles are rebuilt with the new swamp extension fmt trigger the error. However, swamp extension pull from registry also produces failing bundles.

Additional Context

  • .passthrough() and .default() on schemas also trigger this (different Zod instances can't cross-reference internal schema wrappers)
  • Removing those patterns doesn't fix it — the core issue is dual Zod instances
  • Likely fix: swamp should inject its own z into extension bundles at load time rather than letting them import their own copy
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.