Closed kran6a closed 4 weeks ago
Interesting, sounds like zod has the dual-package hazard. Probably can be worked around by making a helper function with a guard return type, which checks the constructor name or something.
@kran6a I just published a prerelease version which should help with this. You can install with npm install trpc-cli@0.3.1-0
.
I was able to repro the issue and that the new version fixes. https://github.com/mmkal/trpc-cli/pull/8. Could you try it out?
It works! Thanks for the quick fix
Reproduction
If you add console.log({parsedArgv}) on trpc-cli index.ts you can see why it does not work:
Apparently import {z} from "zod" and require("zod") are not importing the same classes thus instanceof does not work as intended.