sp85S
Convex Community3y ago
2 replies
sp85

typescript circular reference error

I'm following the sessions middleware blog post and running into a weird issue. Adding the sessions.ts file from https://github.com/get-convex/convex-helpers/blob/main/convex/sessions.ts to my project gives me the following:

[1] Preparing Convex functions...
[0] wait  - compiling...
[0] event - compiled client and server successfully in 66 ms (433 modules)
[1] convex/sessions.ts(88,14): error TS7022: 'create' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
[1] convex/sessions.ts(88,23): error TS2615: Type of property '"sessions:create"' circularly references itself in mapped type 'NameModule<"sessions", typeof import("/Users/me/project/web/convex/sessions")>'.
[1] convex/sessions.ts(88,23): error TS2615: Type of property '"sessions:create"' circularly references itself in mapped type '{ readonly "projects:get": "projects:get"; readonly "projects:list": "projects:list"; readonly "sessions:withSession": never; readonly "sessions:mutationWithSession": never; readonly "sessions:queryWithSession": never; readonly "sessions:create": "sessions:create"; readonly "lib/auth:verifyAuth": never; readonly "us...'.
[1] TypeScript typecheck via `tsc` failed.
[1] To ignore failing typecheck, use `--typecheck=disable`.


Any pointers?
GitHub
A collection of useful code to complement the official packages. - convex-helpers/sessions.ts at main · get-convex/convex-helpers
convex-helpers/sessions.ts at main · get-convex/convex-helpers
Was this page helpful?