Open vhvb1989 opened 1 year ago
Any updates on this @Reshmi-Sriram ?
Apologies, and Thanks for reporting this issue @vhvb1989 !
While the team works on this solution, we recommend to stick to the workaround you suggested by manually adding the staticwebapp.config.json
into the build folder.
cc// @thomasgauvin
@Reshmi-Sriram Do you have any updates/ETA on the fix?
@Reshmi-Sriram Do you have any updates/ETA on the fix?
Before filing this issue, please ensure you're using the latest CLI by running
swa --version
and comparing to the latest version on npm.Are you accessing the CLI from the default port
:4280
?--port
) and accessing the CLI from that port:4280
ℹ️ NOTE: Make sure to enable debug logs when running any
swa
commands using--verbose=silly
Describe the bug swa-cli fails to copy
staticwebapp.config.json
into thebuild
folder when running on a ci build (GitHub actions or Azure DevOps). This is as part ofswa-cli deploy
and then the application has been previously built.To Reproduce Steps to reproduce the behavior:
staticwebapp.config.json
.staticwebapp.config.json
is at the root path of the app-source. For example, for a React Node app structure:Build the application and produce the output folder that contains the static web app. It doesn't matter if you use
swa-cli deploy + swa-cli.config.json
to define how to build the app, or if you just have a script which generates the app. For the previous example, thepackage.json
has a definition for thebuild
script as"build": "react-scripts build",
. Sorect-scripts
is taking care of creating abuild
folder with the contents of the static web app.After generation the
build
folder, run theswa-cli deploy
. This is how I am calling it:Expected behavior swa-cli deploy should work the same locally as running inside a Github action or Azure devops pipeline.
Additional context
Notes:
build
script to manually copy thestaticwebapp.config.json
to the build folder before callingswa-cli
deploy works !!! That is currently my workaround, but I need to manually handle this for every app. I updated thebuild
script to callcp staticwebapp.config.json build/staticwebapp.config.json
after creating the build.