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

SWA broken as of node version 20.13.0 #829

Open
cr3wdayt5p opened this issue May 15, 2024 · 3 comments
Open

SWA broken as of node version 20.13.0 #829

cr3wdayt5p opened this issue May 15, 2024 · 3 comments

Comments

@cr3wdayt5p
Copy link

Describe the bug
The SWA CLI does not work with node version 20.13.0 or later (also tested with 20.13.1 and 22.1.0).

There are no issues with node 20.12.2.

Running swa start does not report any errors. However after succesful startup of swa start the URL https://127.0.0.1:8082 (or https://localhost:8082) simply refuse connections (Chrome report ERR_CONNECTION_REFUSED).

To Reproduce
Steps to reproduce the behavior:

  1. With node 20.12.2 setup some SWA project. Verify that swa start work as expected.
  2. Upgrade to node 20.13.0. SWA is no longer working (but swa start report no errors).

Expected behavior
Nothing should break upgrading from node 20.12.2 to 20.13.0 (or later).

Desktop (please complete the following information):

  • OS: macOS 14.4 (arm64)
  • SWA CLI version: 1.1.7

Additional context

swa-cli.config.json:

{
  "configurations": {
    "app": {
      "appDevserverUrl": "https://127.0.0.1:8081",
      "host": "127.0.0.1",
      "port": 8082,
      "ssl": true,
      "sslCert": "localhost-cert/localhost.crt",
      "sslKey": "localhost-cert/localhost.key"
    }
  }
}
@bzbetty
Copy link

bzbetty commented May 16, 2024

can reproduce.

seems that it's binding to the external ip of the local machine.

@codingoutloud
Copy link

Also reproduced.

swa --version =
1.1.8

sw_vers =
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79

@yamachu
Copy link
Contributor

yamachu commented May 29, 2024

I investigated and it seems that there has been a change in the behavior of node's http module.
ref: nodejs/node#53204

There are two ways to deal with this.
The first is to access it with a localIpAdress address. (e.g. 192.168.xxx.xxx)
The second is to remove the following line (I would like to ask for instructions from the product owner 👀)

server.listen(Number(SWA_CLI_PORT), localIpAdress);

If you do either of these, it looks like you can get it to work with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants