freeCodeCamp
freeCodeCamp copied to clipboard
Zombie Headless Browser challenges
Describe the Issue
Setting Browser.site = "http://localhost:3000";
causes the error TypeError: bind EINVAL 0.0.0.0
Using Browser.site = "http://0.0.0.0:3000";
Or forcing the DNS result order (setDefaultResultOrder)
// add before the test code
const dns = require('dns');
dns.setDefaultResultOrder('ipv4first');
fixes it.
The best I can tell, in newer versions of Node the DNS result order has changed (might have been in v17). We had to fix a different challenge at one point to allow IPv6 IPs. I think this issue is related.
Not sure what the best solution is but we might have to update the boilerplate or the challenge text. We can force the result order in the boilerplate if needed.
Edit: My best guess why we haven't seen this issue more is because we (at least at one point) forced the engine in package.json and possibly Replit running older versions of Node for a long time. I believe most people will see it locally with new versions of Node and I see it on Gitpod running Node 20.
Affected Page
https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/simulate-actions-using-a-headless-browser
Your code
Expected behavior
Not to get an error with the code the challenge tells you to use.
Screenshots
No response
System
- Device: [e.g. iPhone 6, Laptop]
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
- Browser: [e.g. Chrome, Safari]
- Version: [e.g. 22]
Additional context
Forum: https://forum.freecodecamp.org/t/qa-testing-w-chai-were-the-last-2-tests-ever-fixed/678150
:sparkles: Thanks to the community, there's an estimated bounty value of $6.81 USD for a successful merge request of this issue via contributions such as 9.750 STORJ tokens. Happy coding :grinning: Details and T&Cs at joinfuel.io
I think updating the challenge text to expect Using Browser.site = "http://0.0.0.0:3000";
is good.