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

webpack-dev-server can't connect to websocket url on nodejs 18+ #25185

Closed
1 task done
aldrashan opened this issue May 11, 2023 · 3 comments
Closed
1 task done

webpack-dev-server can't connect to websocket url on nodejs 18+ #25185

aldrashan opened this issue May 11, 2023 · 3 comments

Comments

@aldrashan
Copy link

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

Nodejs version 16.19.0

Description

After updating NodeJS to version 18 (or higher), the websocket for live-reloading can't connect anymore.
"WebSocket connection to 'wss://EX021927.examplecompany.com:4200/CRM/ng-cli-ws' failed"
I did not change anything else inside the project after updating the nodejs version.

Minimal Reproduction

Package.json run script:
"ng serve --host=\"EX021927.examplecompany.com\" --public-host \"https://EX021927.examplecompany.com:4200\" --configuration=example"

angular.json:

"architect": {
    "build": {
        "builder": "@angular-devkit/build-angular:browser",
        "options": {
            "baseHref": "/CRM/",
            "deployUrl": "/CRM/",
            "outputPath": "dist/CRM",
            ...
        }
    }
},
"configurations": {
    "example": {
        "fileReplacements": [
	    {
                "replace": "src/environments/environment.ts",
		"with": "src/environments/environment.example.ts"
             }
	],
	"buildOptimizer": false,
	"optimization": false,
	"vendorChunk": false,
	"extractLicenses": false,
	"sourceMap": true,
	"namedChunks": true,
	"outputHashing": "none"
    }
}```

I open the site with "https://EX021927.examplecompany.com/CRM" (no :4200), since I'm also running IIS on port 443 with the url rewrite module active, where /CRM/* gets rewritten to :4200/CMR/*.

### Exception or Error

```text
WebSocket connection to 'wss://EX021927.examplecompany.com:4200/CRM/ng-cli-ws' failed

Your Environment

Working version:
Angular CLI: 15.2.7
Node: 16.19.0
Package Manager: npm 8.19.3
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.7
@angular-devkit/build-angular   15.2.7
@angular-devkit/core            15.2.7
@angular-devkit/schematics      15.2.7
@angular/cli                    15.2.7
@schematics/angular             15.2.7
rxjs                            7.8.1
typescript                      4.9.5


Broken version:
Angular CLI: 15.2.7
Node: 18.16.0
Package Manager: npm 9.5.1
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.7
@angular-devkit/build-angular   15.2.7
@angular-devkit/core            15.2.7
@angular-devkit/schematics      15.2.7
@angular/cli                    15.2.7
@schematics/angular             15.2.7
rxjs                            7.8.1
typescript                      4.9.5

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

I suspect that this has the same root cause of #24442. More context nodejs/node#39987

@aldrashan
Copy link
Author

I suspect that this has the same root cause of #24442. More context nodejs/node#39987

Modifying the ng serve command to use --host="0.0.0.0", like someone suggested in that issue, appears to work.

@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 11, 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