voidV
Convex Community3y ago
3 replies
void

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
            };
        })
    );
});

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
Was this page helpful?