#Why are convex logs appearing in NextJS dev console logs?

7 messages · Page 1 of 1 (latest)

tropic helm
#

Why are convex logs appearing in NextJS dev console logs?

loud shellBOT
#

Hi @tropic helm. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Convex forwards server-side logs to the browser console when you’re using a dev deployment so you can easily debug during development.

  • Convex functions use the normal console.log, console.error, etc., and all of these logs are collected by Convex. [Debugging functions]
  • On a dev deployment, those server logs are also sent back to the client and shown in the browser’s developer tools console for the user who invoked the function. [Debugging functions]
  • On production deployments, logs are not sent to the client, so you won’t see them in the Next.js browser console there. [Debugging functions]

So in Next.js dev, seeing Convex logs in the browser console is expected behavior to help with debugging.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@tropic helm Kapa.ai is still learning and improving, please let me know how I did by reacting below.

tropic helm
#

@loud shell but this is in pnpm run dev for nextjs

loud shellBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

In pnpm run dev for Next.js you’re still hitting your Convex dev deployment, so the behavior is the same:

  • When you use ConvexReactClient against a dev deployment, Convex forwards all server-side console.log / console.error etc. from your Convex functions to the browser, where they show up in the Next.js dev tools console. [Debugging]
  • This only happens for dev deployments; production deployments do not send logs to the client. [Debugging]

So even though you start your app with pnpm run dev (Next.js dev server), the Convex client is still connected to a dev deployment, which is why those Convex logs appear in the Next.js browser console.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: