TypeError: Cannot read properties of undefined (reading ‘message’) during Netlify Deployment

  Kiến thức lập trình

I’m facing an issue with deploying my React front-end code to Netlify. The application works perfectly on my local machine, but when I deploy it to Netlify, I encounter the following error:

enter image description here

I have deployed my backend on Render.com and connected the backend URL with the frontend.

Things I’ve Tried:

  1. Ensured all environment variables are correctly set on Netlify.

  2. Checked the API calls to the backend; they work fine locally.

  3. Verified that the build process completes without errors.

My Setup:

  • Frontend: React, Redux, Redux Toolkit

  • Backend: Node.js, Express (hosted on Render.com)

  • Deployment: Frontend on Netlify, Backend on Render.com

  • Repository: GitHub Link

Additional Information:

  • The error doesn’t provide specific details on which part of the code is causing the issue.

  • The message property being accessed seems to be undefined in some cases during deployment but not locally.

Question: What could be the potential reasons for this error occurring only during deployment on Netlify and not locally? How can I debug or fix this issue?

Any insights or suggestions would be greatly appreciated. Thank you!

Feel free to adjust any part of this draft as needed before posting it on Stack Overflow.

New contributor

Stonic Yt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website