An error occurred in the Server Components render. The specific message is omitted in production bui
Answered
Tan posted this in #help-forum
TanOP
When testing locally, incorrect login credentials on my Next.js application correctly display an "Invalid email or password" message. However, on the production site, the error message reads "An error occurred in the Server Components render," without specifics to avoid leaking sensitive details. This discrepancy is causing confusion as to why the error handling behaves differently between environments.
Answered by B33fb0n3
it's a security thing. In developement next know, that you are the developer and that you are allowed to read it. But in production there is the end user and this end user shoudln't see sensitive details.
To solves this: use safe-actions if you are using server actions or build your own error handling system
To solves this: use safe-actions if you are using server actions or build your own error handling system
3 Replies
B33fb0n3
it's a security thing. In developement next know, that you are the developer and that you are allowed to read it. But in production there is the end user and this end user shoudln't see sensitive details.
To solves this: use safe-actions if you are using server actions or build your own error handling system
To solves this: use safe-actions if you are using server actions or build your own error handling system
Answer
B33fb0n3
@joulev
B33fb0n3