Skip to content
Advertisement

ReferenceError when deploying project to Netlify

I am encountering an issue when deploying my React project to Netlify saying that my editUserInfo function within my profile-info view is not defined. Additionally, I am using React-Router to switch views in my project. This works perfectly in development and all of my links work fine until I try accessing the profile view. Other than this, the site deployed with no issues.

Here is the code for my profile view:

JavaScript

Reference Error:

JavaScript

Any help would be much appreciated!

Advertisement

Answer

Some optimization process Netlify has might drop editUserInfo = as it would be assigned to a global since it’s missing var/let/const.

Try changing it to const editUserInfo = ... instead to see if that helps.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement