get-convex / convex-demos

Demo apps built on Convex.
https://docs.convex.dev/
165 stars 25 forks source link

TypeError: console.time is not a function #27

Open luismartinezs opened 8 months ago

luismartinezs commented 8 months ago

calling console.time errors out when used in the convex backend, example:

export const list = query({
  args: {},
  handler: async (ctx) => {
    console.time("list query time");

    const { tokenIdentifier } = await authGuard(ctx)

    const ideas = await ctx.db.query("ideas")
      .filter((q) => q.eq(q.field("userId"), tokenIdentifier))
      .order("desc")
      .collect();

    console.timeEnd("list query time");

    return ideas
  },
});

Logs:

1/13/2024, 6:53:29 AM
40ms
failure
Query
ideas:list
failure
Uncaught TypeError: console.time is not a function
    at handler (../convex/ideas.ts:106:12)