question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERR_CONNECTION_REFUSED (localhost:3000 only w/ignoreHTTPSErrors)

See original GitHub issue

It’s really hard to debug puppeteer, at least connection errors. Related to #822, I get a ERR_CONNECTION_REFUSED error. Even with DEBUG=*, there’s nothing in the puppeteer logs that shows why the request failed. No stack trace, no weird error, no output from my server, nothing. The only output in Chromium inspector console and puppeteer CLI debug output was ERR_CONNECTION_REFUSED as mentioned.

I also tried the link in Chrome Canary and Chromium on its own, worked OK.

Also, I noticed that I have to manually unset the following header, even though I had set ignoreHTTPSErrors: true; shouldn’t this header get removed if this option is true by default?

page.setExtraHTTPHeaders({ 'upgrade-insecure-requests': '0' });

I think that this is a localhost or a port issue. My server is running at http://localhost:3000 and I have ignoreHTTPSErrors: true option set as mentioned.

I changed the URL I’m navigating to with our production URL and it worked fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
amazzocconecommented, Nov 25, 2017

Hey @niftylettuce how you fixed it? I couldn’t make it work successfully. I look over all the issues, but none of the solutions resolve the problem.

1reaction
Iamcerbacommented, Feb 17, 2022

In my case, I forgot that the application is running in VS Code dev container and localhost is not visible from the container. I have to replace “localhost” with “host.docker.internal”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the ERR_CONNECTION_REFUSED Error in Chrome
The “your connection is not private” error occurs on sites running HTTPS. If the site's certificate isn't valid, the browser intervenes with ...
Read more >
Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
ERR_CONNECTION_REFUSED | How to fix the error - IONOS
Solution 1: Check the website status · Solution 2: Restart the router · Solution 3: Clear Browser Cache · Solution 4: Check proxy...
Read more >
ERR_CONNECTION_REFUSED how to solve - SupportHost
Check site status · Restart the router · Clear cache · Check proxy settings · Change DNS servers · Disable Chrome extensions ·...
Read more >
Localhost Refused to Connect - How to Fix the Error
Temporary Disable the Firewall · Check Localhost IP Address · Check Apache Server Status · Flush the DNS · Change Port Settings ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found