Unable to parse FormData params using prod build
I've bumped into a strange issue that seems to only occur while running a prod build of the app. When running the app in dev, the FormData is parsed as expected, but in prod an empty object is returned. From what I've seen, it appears to be related to checking shape. In dev, shape is updated as expected, but in prod {} is returned because shape instanceof ZodObject || shape instanceof ZodEffects is falsy so shape isn't set correctly.
The following repo contains an example of what I'm seeing. Running npm run dev, entering a term on the "FormData Test" tab, and hitting Save will show the posted data correctly, while running npm run build && npm run preview will show an empty object after entering a term and hitting Save.
https://github.com/corydeppen/params-helper-sveltekit
Interesting. Thanks for the bug report. I haven't seen that happen in my apps. I will definitely take a look.
Yup same here! Gave me a good head scratcher 😆 (also SvelteKit)