Version 1.1.5 not working in Linux/WSL
Describe the bug
When running the command swa deploy, an error occurs during the deploy. This error occurs only in version 1.1.5 in Linux/WSL. The same SWA CLI version works fine in Windows, and versions 1.1.4 and below work fine in Linux/WSL.
To Reproduce Steps to reproduce the behavior:
- Install version 1.1.5:
npm install -g @azure/[email protected] - Type in command 'swa deploy ...'
- See error
Welcome to Azure Static Web Apps CLI (1.1.5)
⠋ Preparing deployment. Please wait...(node:468) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true })
will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
✖ An unknown exception has occurred
Expected behavior
Welcome to Azure Static Web Apps CLI (1.1.4)
✔ Project deployed to https://xxxxxxxxxxx.azurestaticapps.net 🚀
Screenshots
Azure Pipelines:
Desktop (please complete the following information):
- WSL: Ubuntu 22.04.1 LTS, using Node v18.0.0
- Azure Pipelines: Ubuntu 20.04, not sure which version of Node
+1 also getting this error when deploying from a Linux agent.
+1 Also getting the same error when deploying from Linux runner (using Octopus deploy, although I don't think that's relevant)
Also getting the same error on both MacOS and Linux and no way of running an older version (!).
To be clear it seems like it's [email protected] that's causing the error - in our logs I can see [email protected] was working.
for anyone needing a workaround I published my repo locally, created a new gitrepo and pushed the static build to that, created a new static web app and used this git repo, got a deployment token for my actual static web app using swa deploy --print-token and then switched the repo secret to this new key and re-ran the github action.
Did this in a bit of a rush so there's hopefully a less convoluted way to deploy with the broken swa cli out there. Directly using the docker container in https://github.com/Azure/static-web-apps-deploy was on the list as well.
@jimmystridh Earlier today I managed to downgrade to version 1.1.4 by running npm install -g @azure/[email protected]. Then the swa deploy command worked.
@jimmystridh Earlier today I managed to downgrade to version 1.1.4 by running
npm install -g @azure/[email protected]. Then theswa deploycommand worked.
interesting, will give that a try in case I need to deploy again before this is fixed, thanks!
Thanks for the temp fix @gabrielmdesidera
Seeing this too on Ubuntu 22.04.3. Can confirm downgrading to 1.1.4 is a valid workaround, thanks @gabrielmdesidera
I confirm the same issue on MacOS 14 (Sonoma) with 1.1.5, rollback to 1.1.4 fixed the issue. thanks @gabrielmdesidera
Worse, the swa cli exits 0 (success) after printing this error 🤦
Worse, the
swacli exits0(success) after printing this error 🤦
Yup, our CI builds were passing so this went unnoticed for a while until it was noticed the frontend wasn't up-to-date, not great.
Hello all, We have identified and confirmed the issue on Linux. It is caused by the child_process.spawn() function, which swa-cli uses to execute the StaticSiteClient binary. This function behaves differently on Windows and Linux. We are working on a fix and will update as soon as possible. Thank you for your advices and apologise for the inconvenience.
Hello all, We have identified and confirmed the issue on Linux. It is caused by the child_process.spawn() function, which swa-cli uses to execute the StaticSiteClient binary. This function behaves differently on Windows and Linux. We are working on a fix and will update as soon as possible. Thank you for your advices and apologise for the inconvenience.
We have released version 1.1.6. Thanks for your patience and support, and please let me know if there are any other problems.
