How to fix or disable this error in production mode "An error occurred in the Server Components render..." #71099
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You have to look at the logs of your app, with the digest number you get in the error. That being said, I guess, the issue is at the login step. Could you add more logs to the login? |
Beta Was this translation helpful? Give feedback.
-
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. 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)" |
Beta Was this translation helpful? Give feedback.
-
did you solve it ?? |
Beta Was this translation helpful? Give feedback.
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)"