Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Solution part 2: useState and useHistory

Nick Huemmer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 Points

`POST http://localhost:5000/api/users net::ERR_CONNECTION_REFUSED` error when creating a user?

I've worked through the practice code and received the error POST http://localhost:5000/api/users net::ERR_CONNECTION_REFUSED when trying to run it Chrome, Firefox and Edge. It occurs for both the finished practice and client_completed code, so it's not a typo on my part, but something deeper that seems to be happening with localhost.

Since the error is POST http://localhost:5000/api/users net::ERR_CONNECTION_REFUSED, it seems to have something to do with something I did for project 9, but I have no idea what it could be.

I've run npm audit fix after installing both the practice and solution code.

1 Answer

Nick Huemmer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 Points

I just found out that it is later explained in the React Authentication course that errors like this are related to Cross-Origin Resource Sharing (CORS) Support.

It's not covered in the practice - but know that if you get this error in your browser's console, it is covered in later material.