So you have created your react app, and everything works nicely on your localhost / local machine. Then you decide to host it with a service like Netlify,which is an excellent PaaS for static content. All of a sudden your deploy keeps failing 😩. Nightmare right?
Doesn't have to be, firstly check if you have entered all your dotenv values. To do this goto Site Settings > Build & deploy > Environment. You should see environment variables. You will have to rename your variables starting with REACT_APP_ then your variable name, remember to change this on your source code as well. After all this add the variable NODE_VERSION (with the version similar to what you used on your local machine), I was stuck with this issue for days not understanding why I couldn't deploy until I added this.
Hope this was helpful. Please like and share😉.. Happy coding.
Top comments (0)