magicseth
magicseth•2y ago

Circular type references

I'm getting circular type references. I imagine it's my fault. It's always my fault:
Type of property '"queries/addQuery"' circularly references itself in mapped type 'NameModule<"queries/addQuery", typeof import("/Users/sethraphael/Projects/siteguideai/convex/queries/addQuery")>'.
Type of property '"queries/addQuery"' circularly references itself in mapped type 'NameModule<"queries/addQuery", typeof import("/Users/sethraphael/Projects/siteguideai/convex/queries/addQuery")>'.
7 Replies
ballingt
ballingt•2y ago
It might not be here, you can probably fix this with explicit type annotations.
magicseth
magicsethOP•2y ago
what does that mean 🙂
ballingt
ballingt•2y ago
for making an example, are you using TypeScript or JavaScript for your Convex functions? There are a few ways this can happen, we need to find some repros to add to our test suite. If there's a portion of this code you can share would love to see it. Explicit type annotations as a TypeScript-only thing: in TypeScript you can add type annotations to the return type of a function, and one of the causes of circular type references can be fixed this way.
ballingt
ballingt•2y ago
No description
magicseth
magicsethOP•2y ago
Typescript
lee
lee•2y ago
conversely, i hit a case where removing an explicit type annotation fixes this kind of error. so you could try both 🙂
magicseth
magicsethOP•2y ago
Tom I'll send you a link to the rpo It's vexing

Did you find this page helpful?