void
void
CCConvex Community
Created by void on 9/11/2023 in #show-and-tell
iss.fyi - International Space Station Tracking
No description
1 replies
CCConvex Community
Created by void on 8/26/2023 in #support-community
convex codegen tsc failing with type errors with no code changes
I have a project that's using "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
I've been building things successfully all week and this just started happening.
2 replies
CCConvex Community
Created by void on 8/15/2023 in #support-community
Exported query missing type annotations when building convex in another directory other than root
I have a query that looks like this (src/convex/steam.ts):
export const listAll = query(async ({ db }) => {
const steamAccounts = await db.query('steamAccounts').collect();
return Promise.all(
steamAccounts.map(async (steamAccount) => {
const discordUser = await db.get(steamAccount.discordUser);
const server = (await db.get(discordUser!.server))!;
return {
server,
discordUser,
steamAccount
};
})
);
});
export const listAll = query(async ({ db }) => {
const steamAccounts = await db.query('steamAccounts').collect();
return Promise.all(
steamAccounts.map(async (steamAccount) => {
const discordUser = await db.get(steamAccount.discordUser);
const server = (await db.get(discordUser!.server))!;
return {
server,
discordUser,
steamAccount
};
})
);
});
When building with my convex.json specifying src/convex of my directory, tsc fails for this reason:
src/convex/steam.ts:70:14 - error TS2742: The inferred type of 'listAll' cannot be named without a reference to '../../node_modules/convex/dist/types/server/registration'. This is likely not portable. A type annotation is necessary.

70 export const listAll = query(async ({ db }) => {
~~~~~~~


Found 1 error in src/convex/steam.ts:70
src/convex/steam.ts:70:14 - error TS2742: The inferred type of 'listAll' cannot be named without a reference to '../../node_modules/convex/dist/types/server/registration'. This is likely not portable. A type annotation is necessary.

70 export const listAll = query(async ({ db }) => {
~~~~~~~


Found 1 error in src/convex/steam.ts:70
4 replies