You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
With node 20.12.2 setup some SWA project. Verify that swa start work as expected.
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):
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 👀)
Normally when you are developing an application using the SWA CLI, you would access the web front application by accessing http://127.0.0.1:8082 or http://localhost:8082
Instead, you access it by typing the localIp address(private ip address?) in the address bar of your browser within the network to which the machine you are currently serving is part of (you can see this address in ifconfig, etc.).
Activity
bzbetty commentedon May 16, 2024
can reproduce.
seems that it's binding to the external ip of the local machine.
codingoutloud commentedon May 21, 2024
Also reproduced.
swa --version =
1.1.8
sw_vers =
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79
yamachu commentedon 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 👀)
static-web-apps-cli/src/msha/server.ts
Line 174 in 352be8f
If you do either of these, it looks like you can get it to work with
johnnyreilly commentedon Jun 18, 2024
Yusuke Yamada (@yamachu) can you expand on what you mean by:
please?
yamachu commentedon Jun 18, 2024
John Reilly (@johnnyreilly)
Normally when you are developing an application using the SWA CLI, you would access the web front application by accessing http://127.0.0.1:8082 or http://localhost:8082
Instead, you access it by typing the localIp address(private ip address?) in the address bar of your browser within the network to which the machine you are currently serving is part of (you can see this address in ifconfig, etc.).
johnnyreilly commentedon Jun 18, 2024
Ah I see - so this would not be something that you could commit to source control as it would be potentially different for each user.
Incidentally I can reproduce this with 1.1.9 also.
bzbetty commentedon Jun 18, 2024
Highly recommend using patch-package (https://www.npmjs.com/package/patch-package) on this project at this point.
Lets you do little tweaks like the above PR and check it into source control so any developer on the team can benefit.
adrianhall commentedon Jun 28, 2024
We've released version 1.1.10 recently that explicitly has Node 20 support. Please let us know if you are still having problems.
Thanks!