convex codegen tsc failing with type errors with no code changes
I have a project that's using
I've been building things successfully all week and this just started happening.
"convex": "^1.0.3",
and randomly today running npx convex codegen
started failing with the following type errors:
writing api.d.ts
writing api.js
✖ TypeScript typecheck via `tsc` failed.
To ignore failing typecheck, use `--typecheck=disable`.
src/convex/_generated/server.d.ts:17:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericActionCtx'.
17 GenericActionCtx,
~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:18:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericMutationCtx'.
"graphql": "^16.8.0",
18 GenericMutationCtx,
~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:19:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericQueryCtx'.
19 GenericQueryCtx,
~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:20:3 - error TS2724: '"convex/server"' has no exported member named 'GenericDatabaseReader'. Did you mean 'DatabaseReader'?
20 GenericDatabaseReader,
~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:21:3 - error TS2724: '"convex/server"' has no exported member named 'GenericDatabaseWriter'. Did you mean 'DatabaseWriter'?
21 GenericDatabaseWriter,
~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:76:30 - error TS2314: Generic type 'ActionBuilder' requires 1 type argument(s).
76 export declare const action: ActionBuilder<DataModel, "public">;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:84:38 - error TS2314: Generic type 'ActionBuilder' requires 1 type argument(s).
84 export declare const internalAction: ActionBuilder<DataModel, "internal">;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 7 errors in the same file, starting at: src/convex/_generated/server.d.ts:17
writing api.d.ts
writing api.js
✖ TypeScript typecheck via `tsc` failed.
To ignore failing typecheck, use `--typecheck=disable`.
src/convex/_generated/server.d.ts:17:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericActionCtx'.
17 GenericActionCtx,
~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:18:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericMutationCtx'.
"graphql": "^16.8.0",
18 GenericMutationCtx,
~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:19:3 - error TS2305: Module '"convex/server"' has no exported member 'GenericQueryCtx'.
19 GenericQueryCtx,
~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:20:3 - error TS2724: '"convex/server"' has no exported member named 'GenericDatabaseReader'. Did you mean 'DatabaseReader'?
20 GenericDatabaseReader,
~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:21:3 - error TS2724: '"convex/server"' has no exported member named 'GenericDatabaseWriter'. Did you mean 'DatabaseWriter'?
21 GenericDatabaseWriter,
~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:76:30 - error TS2314: Generic type 'ActionBuilder' requires 1 type argument(s).
76 export declare const action: ActionBuilder<DataModel, "public">;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/convex/_generated/server.d.ts:84:38 - error TS2314: Generic type 'ActionBuilder' requires 1 type argument(s).
84 export declare const internalAction: ActionBuilder<DataModel, "internal">;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 7 errors in the same file, starting at: src/convex/_generated/server.d.ts:17
1 Reply
@void we did release a new Convex version today that requires rerunning codegen, maybe you updated (could happen when reinstalling dependencies without a lockfile?) and need to run
npx convex codegen