Next.js Discord

Discord Forum

An error occurred in the Server Components render.

Unanswered
Brown bear posted this in #help-forum
Open in Discord
Brown bearOP
In production i get this error message, but it work just fine in dev environment

8 Replies

Brown bearOP
Here is my code
Send us the error on vercel as well
Brown bearOP
Error: Convencional inativo
    at a (/var/task/.next/server/app/(dashboard)/inscricao/page.js:1:5063)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:489
    at async rc (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:14:5137)
    at async rj (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:21988)
    at async et (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:24802)
    at async es.responseCache.get.routeKind (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:1006)
    at async rX.renderToResponseWithComponentsImpl (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:463)
    at async rX.renderPageComponent (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:4676)
    at async rX.renderToResponseImpl (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:5259)
Brown bearOP
That's in development
im going to assume you can't use try catch for doing this method of transfering data
if it can show the value in dev but nothingness in prod
Brown bearOP
so, how i can catch errors from server actions and show them in toasts?
personally, id return an object saying if it successed and have either the error message or success data (but bool to easily know)