Next.js Discord

Discord Forum

Outputting a response from the backend to the console in an unreadable form

Unanswered
Lionhead posted this in #help-forum
Open in Discord
LionheadOP
Hello
Please tell me, I am developing a project on Nextjs14 with app routing requests using fetch nextjs
I am faced with the fact that when I receive a response to a request in the server component and need to display it through console.log() for viewing, it will display in the form as shown in the photo below, although in the code I process the received data as const data = await response.json(); but still the output in the console is not viewable

Also, is it possible to view requests that are sent in server components somehow their request body, response
like client requests are displayed in the network section in devtools?
Help please


Translated with DeepL.com (free version)

1 Reply

Northeast Congo Lion
That's how javascript prints a deeply nested structure. Use the JSON.stringify(data) function in your console.log instead.