Hi.
I faced this issue even with corrected code and didn’t find any workaround.
Finally, I came across a comment.. mentioning to add the following to server.js file.
const dns = require(‘dns’);
dns.setDefaultResultOrder(‘ipv4first’);
This was ironic, because there’s a big “PLEASE DO NOT EDIT THIS FILE” comment on top of server.js.
Anyway, this worked, and the test passed!
Maybe the boilerplate-express → server.js file should be updated to include this from the get go, to avoid this issue.
The Issue
By default, Node.js may return IP addresses in IPv6 format (like ::1 for localhost) instead of IPv4 (127.0.0.1).
The freeCodeCamp test suite expects the logger output to show the IP in IPv4 format (e.g., 127.0.0.1 or ::ffff:127.0.0.1), not pure IPv6 (::1).
When Node.js returns IPv6 addresses, your logger outputs something like:
GET / - ::1
instead of:
GET / - 127.0.0.1
The test fails because it’s looking for the IPv4 format.
Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.