Next.js生产模式下的错误 – 摘要:1782794309

huangapple go评论66阅读模式
英文:

Next.js error in production mode - Digest: 1782794309

问题

I use Next 13.4.3. I don't have an API folder in the app folder as described here, by default all pages.tsx etc. are in the app folder SSR: https://nextjs.org/docs/app/building-your-application/routing/router-handlers. In my main page /app/page.tsx I do a fetch when called to load data from MongoDB (app/products/route.ts). Everything works locally as soon as I switch to production mode, I get the error below

Next.js生产模式下的错误 – 摘要:1782794309

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

And in the Chrome Debugger Console:

139-fafe6b4f143efdb1.js:1 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.

if i click on 139-fafe6b4f143efdb1.js i got this:

Next.js生产模式下的错误 – 摘要:1782794309

How do I find out where the error is?

英文:

I use Next 13.4.3. I don't have an API folder in the app folder as described here, by default all pgaes.tsx etc. are in the app folder SSR: https://nextjs.org/docs/app/building-your-application/routing/router-handlers. In my main page /app/page.tsx I do a fetch when called to load data from MongoDB (app/products/route.ts). Everything works locally as soon as I switch to production mode, I get the error below

Next.js生产模式下的错误 – 摘要:1782794309

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

And in the Chrome Debuger Console:

>139-fafe6b4f143efdb1.js:1 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.

if i click on 139-fafe6b4f143efdb1.js i got this:

Next.js生产模式下的错误 – 摘要:1782794309

How do I find out where the error is?

答案1

得分: 1

检查服务器组件中的请求。你是否捕获查询错误?我认为 promise 被拒绝。

英文:

Сheck your requests in the server component. Do you catch query errors? I think the promise was rejected

[1]: https://i.stack.imgur.com/6XJ4C.png

huangapple
  • 本文由 发表于 2023年5月22日 19:24:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76305664.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定