Skip to content

How to fix or disable this error in production mode "An error occurred in the Server Components render..." #71099

Discussion options

You must be logged in to vote

I have gotten a solution to it. So, the issue comes from the error logging to the terminal. In production nextjs try to protect the app from releasing sensitive information to client because it cannot tell if the error is internal or external.
For example:
If the error is coming from a third-party service, you are using it might contain sensitive info like api-key, user ids, etc.

So, the solution was to find a different method to log the error to the user.

"client side code (login page function)"

"Server side code (Action)"

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dhayford92
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants