Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng serve --allowed-hosts results in ERR_CONNECTION_REFUSED #25194

Closed
1 task done
MrAlexBailey opened this issue May 12, 2023 · 2 comments
Closed
1 task done

ng serve --allowed-hosts results in ERR_CONNECTION_REFUSED #25194

MrAlexBailey opened this issue May 12, 2023 · 2 comments

Comments

@MrAlexBailey
Copy link

MrAlexBailey commented May 12, 2023

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Node v16

Description

Running ng serve with an allowed-hosts setting will not connect with Node v18 on Windows.

Minimal Reproduction

Angular setup:

ng new testapp
cd testapp
ng serve --port 80 --allowed-hosts testing.local.dev.com

Windows HOSTS:

# Windows/system32/drivers/etc/HOSTS


127.0.0.1 testing.local.dev.com

Exception or Error

With Node v16.20.0 the example serves normally in a browser @ `testing.local.dev.com`

With Node v18.16.0 the example errors in a browser with `ERR_CONNECTION_REFUSED`

These are both using NG 16.0.1

Your Environment

> testapp@0.0.0 ng
> ng version


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 16.0.1
Node: 18.16.0
Package Manager: npm 9.5.1
OS: win32 x64

Angular: 16.0.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.1
@angular-devkit/build-angular   16.0.1
@angular-devkit/core            16.0.1
@angular-devkit/schematics      16.0.1
@schematics/angular             16.0.1
rxjs                            7.8.1
typescript                      5.0.4

Anything else relevant?

Not sure if this issue is node, webpack, or angular related, so if it belongs somewhere more appropriate, any help getting it there would be appreciated.

@alan-agius4
Copy link
Collaborator

Same root cause as #24442.

More context: nodejs/node#39987.

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants