zod
zod copied to clipboard
v4: z.file() fails in edge runtime in next.js server action
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
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.