8000 v4: z.file() fails in edge runtime in next.js server action · Issue #4112 · colinhacks/zod · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v4: z.file() fails in edge runtime in next.js server action #4112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lr0pb opened this issue Apr 11, 2025 · 1 comment
Closed

v4: z.file() fails in edge runtime in next.js server action #4112

lr0pb opened this issue Apr 11, 2025 · 1 comment

Comments

@lr0pb
Copy link
lr0pb commented Apr 11, 2025

When parsing schemas with new z.file() in edge runtime in next.js server actions it throws TypeError: Cannot read properties of undefined (reading 'args') error

Repro: https://github.com/lr0pb/zod-file-server-action-repro
Server actions parsing fails, while similar parsing in route handler also with edge runtime - works fine

@colinhacks
Copy link
Owner
colinhacks commented Apr 12, 2025

There's a fix in the latest beta. Upgrade and let me know how it goes. Not sure if it'll work in production or not...still seeing the warning. Zod is designed to fall back to a non-Dynamic Code Evaluation approach when eval isn't supportd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0