fix: use default import for zod/v4 to support Deno/esm.sh (#1182) #1194
+13
−13
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.
Changes
import * as z from 'zod/v4'toimport z from 'zod/v4'(namespace import to default import) across all files that use zod/v4 to fix compatibility with Deno environments using esm.sh.This change fixes issue #1182 where the SDK causes a
TypeError: e.custom is not a functionwhen deployed to Deno environments (like Supabase Edge Functions) and loaded via esm.sh.When esm.sh bundles the SDK for Deno, the zod/v4 module's named exports (
z.custom,z.string,z.object, etc.) are not available on the namespace import. Withimport * as z, these functions become undefined. They only exist onz.default.How Has This Been Tested?
Breaking Changes
None
Types of changes
Checklist
Additional context
Impact: