Closed dawidmucha closed 2 years ago
In the hindsight, I didn't specifically set the port within my process.env
file, so it was automatically set to 5000, while the further code refers to a port 3000.
Still, I feel like it's an overlook on the tutorial's part with mixed ports that can confuse less experienced developers, especially because create-react-app
will automatically set the front-end's port to 3000, which collides with the 3000 port provided for the backed.
I'm gonna check tomorrow if it fixes my issue, but even though, I think it would be a good idea to alter the tutorial so it used port 5000 exclusively for back-end.
I tested and yes, it was the issue with ports.
I'm going to keep the issue open because It's something that should be fixed/rephrased in the tutorial. Ideally, all of the axios methods should be set with the port 5000, since 3000 is already taken by create-react-app
.
Additionally, all of the navbar.js
section is inside recordList.js
's code block. It's just a visual thing, but it's an issue nonetheless.
Hi @dawidmucha
Thank you for highlighting this, we are on it.
Thank you so much for reporting this @dawidmucha. We have fixed the article as you recommended, you can see it live right now. https://www.mongodb.com/languages/mern-stack-tutorial
First of all, It happened on my personal copy of the project, so i went and pulled this repo and still get the same error.
Upon creating a new record, after clicking the "Create Person" button, it doesn't add the record. I get the 404 error in console, although, when I catch the error, it stills shows the 404 code with no additional information.
I tried to manually send HTTP requests via Postman and it prints "Cannot POST /record/add". Using GET on /records should list all records, yet it throws 200 OK and returns empty React page:
I don't know where it is the problem, but judging from the fact that I get it on both my own, and this freshly pulled repo, it seems that the tutorial itself has an error. I'd appreciate if someone could've looked at it.