'npm start in React app opens different url unpredictably
Tried to run npm start on a project I hadn't looked at in a couple weeks and when I did it opens up localhost:3000/myname/partofmyprojectname instead of just localhost:3000/
When I go to localhost:3000/ there's an error in my terminal
Really confusing because it worked last time I tried it and I didn't change anything I don't think.
Solution 1:[1]
As I was making this question I found the solution from this post:
In my package.json, "homepage"'s value was the path to the readme in the github repo: "https://github.com/myname/my-app-frontend#readme" (don't know how that happened). I just changed that to '/'.
I'm thinking maybe my version of react-scripts updated and npm start was deferring to the homepage key in the package.json but not totally sure.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | emplexus |
