colinhacks / zod

TypeScript-first schema validation with static type inference
https://zod.dev
MIT License
33.95k stars 1.19k forks source link

fix(types): fix type cache crash #3841

Open odbol opened 5 days ago

odbol commented 5 days ago

There's some kind of weird race condition or something where the strict null check fails but then returns an undefined object.

See https://github.com/firebase/genkit/issues/972 for details on how to reproduce.

  name: 'TypeError',
  message: "Cannot destructure property 'shape' of 'this._getCached(...)' as it is undefined.",
  stack: "TypeError: Cannot destructure property 'shape' of 'this._getCached(...)' as it is undefined.\n" +
    '    at ZodObject._parse (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:1848:17)\n' +
    '    at ZodObject._parseSync (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:146:29)\n' +
    '    at /Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:1711:29\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at ZodArray._parse (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:1710:38)\n' +
    '    at ZodObject._parse (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:1864:37)\n' +
    '    at ZodObject._parseSync (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:146:29)\n' +
    '    at ZodObject.safeParse (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:176:29)\n' +
    '    at ZodObject.parse (/Users/fuego/Documents/development/gemineye-server/node_modules/zod/lib/types.js:157:29)\n' +
    '    at /Users/fuego/Documents/development/gemineye-server/node_modules/@genkit-ai/flow/lib/flow.js:522:55',
netlify[bot] commented 5 days ago

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
Latest commit f2815768ae389c9b47065a6741116b9e2d3589a8
Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/672d1f1df89cea0008372d19
Deploy Preview https://deploy-preview-3841--guileless-rolypoly-866f8a.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.