SWA CLI - Deploying web app does not work

Nirmal Dhandapani 20 Reputation points
2025-04-11T12:36:30.6933333+00:00

My issue is identical to the one posted here by James Pierce.

One minor difference is that my output folder is "dist".

I try to use the command

swa deploy --env "Production" -n arka-360-test2

but it does not get deployed. There are no errors either.

User's image

Node version: 20.19.0

Azure CLI Version: 2.71.0

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,128 questions
{count} votes

Accepted answer
  1. Prabhavathi Manchala 815 Reputation points Microsoft External Staff
    2025-04-11T20:14:19.17+00:00

    Hi Nirmal Dhandapani,

    The deployment issue happened because the index.html file was missing from your dist folder, which is necessary for the app to run. The SWA CLI didn't show a specific error, as it expects the build process to be complete with all necessary files in the output folder.

    • Before deploying, ensure the index.html file is present in your build output dist folder.
    • Rebuild your app by running the build command npm run build to generate all necessary files, including index.html.
    • Please verify the dist folder to confirm that index.html and other required files (like JavaScript and CSS) are present before redeploying.
    • Once the files are confirmed, redeploy using the SWA CLI with the appropriate command.
    swa deploy --env "Production" --app-location dist -n arka-360-test2 –verbose
    

    Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nirmal Dhandapani 20 Reputation points
    2025-04-11T19:31:22.8533333+00:00

    Never mind, I asked ChatGPT for help and it helped me realise that the absence of index.html in the "dist" folder was the issue. It seems abnormal that the SWA CLI wouldn't throw an error for this requirement though.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.