-
Notifications
You must be signed in to change notification settings - Fork 124
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 1.0.3 with Node18 - Can't reach api endpoint #598
Comments
I second here. As discussed in #564 swa CLI is not working with functions 4 (.net SDK at least) using node 18 LTS, even after updating to .net7 on Windows 11. The "workaround" is using node 16, which works just fine |
@jouz3, is it possible to share your repo details? Also, can you please retry the scenario and let me know if the issue persists because I tested the scenario and I didn't find any issue. |
Same issue following "vanilla" static web site and api instructions precisely. OS: OS X 13.0.1 (Ventura) I can perform "swa start" which binds localhost:4280, or "swa start src --api-location api" which binds localhost:7071 but I cannot get both to occur following the directions in https://learn.microsoft.com/en-us/azure/static-web-apps/add-api?tabs=vanilla-javascript I tried the following, prior to which the "swa start src --api-location api" command would fail to start the api server on localhost:7071:
|
Hey @arobthearab , @jouz3 we're able to reproduce the same issue locally. Seems like something is breaking with azure function core tools v4 with Node18 installed. We're investigating this issue and will get back to you soon. Meanwhile please try to downgrade the version of Node 16. Please feel free to contribute if anyone has any discoveries. Thanks. |
This still fails for me on Node 16. I can hit the web app at the 7175 port below. But if I try at 4280 it says "the site can't be reached". I am using Node 16 and Chrome on Windows 11. (Note: I'm new to this; following a tutorial). Thanks. Here is the profiles node of my Client launchsettings.json. I've tried with and without the launchUrl delared. "profiles": { And here is the output c:\PositiveSum\Code\Samples\Scratchest>swa start https://localhost:7175/ --verbose=silly Welcome to Azure Static Web Apps CLI (1.0.3) Getting config file options from swa-cli.config.json... WARNING: This emulator may not match the cloud environment exactly. * appLocation: c:\PositiveSum\Code\Samples\Scratchest |
I tried again with additional repro steps and hit a seemingly related issue: |
For me, the command |
I was receiving the same could not connect message and discovered it was simply my host file not routing localhost. I learned that swa uses the 'wait-on' library to check for the host. Maybe logging the error response from 'wait-on' is needed. I executed the wait on using npx:
I received the following:
Hope this helps! My original error message:
|
I have also the "Could not connect to "http://localhost:7071". Is the server up and running" issue when node 18 and swa 1.0.4 |
similar issue is blocking customer from using SWA cli as their policies prohibit use of node16, and require node18 ... any ETA on when SWA will be compatible with node18? |
Hi all, |
@Reshmi-Sriram Are you sure (regarding node 18 is in preview) ? |
Hey @dnkh, |
Something I found odd is this issue with node 18 is happening in Windows 11 (in my case), but is working fine in Linux (Ubuntu) I am using the latest swa (1.0.6) btw |
Is there any progress on that? Why can I not access port 4280 with both static web site and API via /api? Would need that... |
I'd like to chime in as well. The issue seems sporadic for me, sometimes it'll work with Node 18, other times it'll just refuse to cooperate. If I run or debug the Functions app and get prompted for developer tools access after a reboot, etc, is when the swa cli seems to give up with Node 18. Rebooting again after entering the password for the prompt seems to fix the problem and I can use Node 18 again. I can also use Node 16 via NVM without said reboot if I'm in a hurry. |
In my case SWA couldn't "see" the function app, although it was working fine when I've accessed it directly in the browser.
After spending some time to investigate, it turns out that this was related to this issue: So to check if this is the case for you, try substituting "localhost" for "127.0.0.1", like this:
Finally, in order to be able to still use "localhost", I've ended up changing the precedence of IP address resolution. On Windows (10), you can change the precedence of IP address resolution to prefer IPv4 over IPv6 by modifying the Windows registry. Here's how to do it:
|
Please feel free to track the original issue #663 |
Just wanted to follow-up and mention that you should also make sure you're not being dumb like I was and make sure you cd into the actual project directory first before running the tool. 🤦♂️ Though it would be nice if the CLI could mention that no SWA config was found or something to give the developer a hint. |
Same issue here, I am using Windows 11 and
After following @danvdumitriu 's advice making sure IPv4 had precedence over IPv6 everything works. So it seems as if the issue is related (in Windows) to the resolution of I guess that should work but something in the stack makes it not work. |
Describe the bug
The last version of the swa cli (1.0.3) doesn't seem to work with NodeJS LTS 18.12.1 on a Blazor WASM with dotnet functions.
The swa cli can't connect to the api endpoint, but it works outside the swa cli either by running it via
swa start
orfunc host start
:[swa] ✖ Could not connect to "http://localhost:7071/". Is the server up and running?
To Reproduce
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: