Can't use zid from convex-helpers for my schema definition
need help: somehow can't use
zid
from convex-helpers
,
for the context: I'm using it to define my schema.
getting this: Exported variable 'productFields' has or is using name 'ZidDef' from external module "/Users/shoxruz/personal/rassvet/node_modules/convex-helpers/server/zod" but cannot be named.
8 Replies
this is how I'm using it: @ian
@Cruz have you made any changes to your convex/tsconfig.json? Can you tell if this error comes from the Convex typecheck or your web application's typecheck? If you run
npx convex dev
separately from your frontend (usually npm run dev
runs both together) I'm curious which one causes this.
You might be telling TypeScript to emit declarations when convex-helpers/server/zod
isn't set up for that.I'm using monorepo and this is my base tsconfig and extending it for convex/tsconfig:
ah yeah
"composite": true
implies "declaration": true
To check that this is the issue could you try commenting out "declaration": true
and seeing if the issue persists?
If this is it the fix then it's going to require a new release of convex-helpers, could you open an issue at https://github.com/get-convex/convex-helpers/issues ? I'll check if I can repro.yeah you were right, removing
declaration: true
solved the problem
here is the github issue: https://github.com/get-convex/convex-helpers/issues/50GitHub
Can't use zid from convex-helpers · Issue #50 · get-convex/convex-h...
Problem: Getting ts error when using zid from convex-helpers if in tsconfig "declaration": true
For now I will disable
declaration
, pls let me know when you guys release the fix so I can enable it 🙏Glad to here you're unblocked for now, we'll let you know!
I updated in the ticket, but in case you didn’t see it, this is fixed in 0.1.10 @Cruz
Thanks for the report and sorry you hit it