Next.js Discord

Discord Forum

An error occurred in the Server Components render.

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

8 Replies

Avatar
Brown bearOP
Here is my code
Image
Image
Avatar
B33 underestimated me correct :(
Send us the error on vercel as well
Avatar
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)
Avatar
Brown bearOP
That's in development
Image
Avatar
Risky
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
Avatar
Brown bearOP
so, how i can catch errors from server actions and show them in toasts?
Avatar
Risky
personally, id return an object saying if it successed and have either the error message or success data (but bool to easily know)