Open sndrem opened 1 year ago
If i downgrade to 1.1.1 then everything works as expected
Can you also provide the Typescript version that your TS server is using?
4.9.4 is the typescript version being used. I have updated my original question as well.
FWIW, I'm also seeing this error on 1.2.0
with TypeScript 4.7.4
Best I can tell, the only change since 1.1.1
that could possibly impact toFormikValidationSchema
behavior would be the change from Zod ~3.14.4
to ^3.14.4
, since Zod is up to 3.20.2
now. 🤔
Unfortunately, if I downgrade my project to exactly Zod 3.14.4
while remaining on Zod Formik Adapter 1.2.0
, then restart my TS server in VS Code, the error still occurs! 😖 NPM dependency hell is "fun" to troubleshoot when project behavior can differ by when dependencies were frozen in lockfile.
For now, downgrading both zod
& zod-formik-adapter
is the only thing that provides relief:
"zod": "~3.14.4",
"zod-formik-adapter": "~1.1.1"
... and then we're back to this library having an opinion about React compatibility 😦
This issue happens to me, as well 😦
"typescript": "5.1.6",
(...)
"zod": "^3.22.4",
"zod-formik-adapter": "^1.2.0",
I'm getting this error as well, has there been any fix ?
Same here on 1.3.0. The only solution I could find for now is either to @ts-ignore
it or downgrade to 1.1.1 as per @sndrem's answer.
Describe the bug Not sure if a bug, but when I tried to use the
toFormikValidationSchema(Schema)
, I get a warning sayingType instantiation is excessively deep and possibly infinite.
. This seems to stress the typescript server in vs code. If I comment out this linevalidationSchema={toFormikValidationSchema(Schema)}
then VS Code works as expected. Not sure why this is. I have not had this problem in the past. I just updated to version 1.2.0.To Reproduce Steps to reproduce the behavior:
validationSchema={toFormikValidationSchema(Schema)}
to your Formik componentType instantiation is excessively deep and possibly infinite
Expected behavior I expect the code to not give errors and validate my form as expected
Screenshots
Desktop (please complete the following information):
Node version:
Zod, Formik and zod-formik-adapter versions: zod: "^3.20.2", zod-formik-adapter: "^1.2.0", formik: "^2.2.9" Typescript: 4.9.4
Additional context I have tried to turn my computer on and off, restarted the ts server in vs code, and restarted vs code. It only seems to be working correctly if I do not include the validationSchema.