Next.js Discord

Discord Forum

Logs are not shown in dashboard

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Hi folk!
Currently, I use the following code:

file: apps/web/src/pages/api/v1/auth/foo.ts
import type { NextApiRequest, NextApiResponse } from 'next'

async function handler (req: NextApiRequest, res: NextApiResponse) {
  console.log('foo')

  res.json({})
}

export default handler


I deployed it to Vercel, and when invoked GET /api/v1/auth/foo, an empty object is returned correctly.
Anyway, when I accessed the dashboard to see the logs, I found the request log without "messages" (the column is empty), as the image shows.

I also tried to use the CLI (vercel logs <deployment-id> --follow), but those are the logs it shows:
2024-01-17T13:13:14.076Z  Duration: 132.38 ms    Billed Duration: 133 ms    Memory Size: 1024 MB    Max Memory Used: 122 MB    


What am I doing wrongly?

Thanks

0 Replies