8

I am new to using NextJS and am trying to get my first project up in production. But I am seeing this error:

Application error: a client-side exception has occurred (see the browser console for more information).
Digest: 4266806755

It seems to me like this digest property should be able to be inspected in some way, but I cannot find information on how to do this.

What is this digest property and how would I go about using it to troubleshoot my issue?

Of course it works perfectly well when testing locally using my localhost. But when I am running my code in production I saw the above error. Upon inspection of the container running my code, I see

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:6571:19)
    at successSteps (node:internal/deps/undici/undici:6545:27)
    at node:internal/deps/undici/undici:1211:60
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:6571:19)
    at successSteps (node:internal/deps/undici/undici:6545:27)
    at node:internal/deps/undici/undici:1211:60
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
  digest: '4266806755'
}

I am expecting to see no errors. But since I see this one, I would like to be able to inspect the error.

1
  • The error's pretty clear in what you need to do: The specific message is omitted in production builds to avoid leaking sensitive details so run the same steps on your development/staging instance to see the real error. Commented Aug 20, 2023 at 17:24

1 Answer 1

3

Here is your answer in the NextJS docs. Other than that, I don't know what or where the problem is in your code. Time to debug :)

https://nextjs.org/docs/app/building-your-application/routing/error-handling#handling-server-errors

But in case you don't understand, you need to go through your server-side logs, and match the digest hash that is in the error message with the same hash in the logs, to find where the error happened at exactly.

Sign up to request clarification or add additional context in comments.

3 Comments

Any idea on how to use this digest in tracking down the error in the Vercel runtime logs?
I think this answer may be misleading because it assumes there is server side error log file.
So there is not ? What can we do with this digest?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.