You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object.freeze() does not indicate to TypeScript that it should treat the value as a const. It returns readonly string[] which means z.enum() isn't able to infer the individual enum elements. Try Object.freeze(["a","b"] as const) if you want to freeze, but you'll definitely need as const.
zod version: 3.24.3
Sandbox reproduction: https://codesandbox.io/p/sandbox/866jqq
as const
works but freezing the object fails withNo overload matches this call
.Is this expected behavior? If so why?
The text was updated successfully, but these errors were encountered: