proxy not working for react and node
I experienced this issue quite a few times, and I figured it's because of the cache. To solve the issue, do the following
Edit: @mkoe said that he was able to solve this issue simply by deleting the package-lock.json file, and restarting the app, so give that a try first. If that doesn't resolve it, then do the following.
- Stop your React app
- Delete package-lock.json file and the node_modules directory by doing
rm -r package-lock.json node_modules
in the app directory. - Then do
npm install
in the app directory.
Hopefully this fixed your proxy issue.
The reason the react application is still pointing at localhost:8080 is because of cache. To clear it , follow the steps below.
- Delete
package-lock.json
andnode_modules
in React app- Turn off React Terminal and
npm install
all dependencies again on React App- Turn back on React App and the proxy should now be working
This problem has been haunting me for a long time; but if you follow the steps above it should get your React application pointing at the server correctly.