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:
-
Ensured all environment variables are correctly set on Netlify.
-
Checked the API calls to the backend; they work fine locally.
-
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.