Cruz
Cruz•13mo ago

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.
No description
8 Replies
Cruz
CruzOP•13mo ago
this is how I'm using it: @ian
ballingt
ballingt•13mo ago
@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.
Cruz
CruzOP•13mo ago
I'm using monorepo and this is my base tsconfig and extending it for convex/tsconfig:
No description
ballingt
ballingt•13mo ago
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.
Cruz
CruzOP•13mo ago
yeah you were right, removing declaration: true solved the problem here is the github issue: https://github.com/get-convex/convex-helpers/issues/50
GitHub
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
Cruz
CruzOP•13mo ago
For now I will disable declaration, pls let me know when you guys release the fix so I can enable it 🙏
ballingt
ballingt•13mo ago
Glad to here you're unblocked for now, we'll let you know!
ian
ian•12mo ago
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

Did you find this page helpful?