static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

Dependency on json.schemastore.org breaks CLI

Open itpropro opened this issue 2 years ago • 21 comments

The SWA CLI currently fails and stops after a few seconds, because either the latency of https://json.schemastore.org/staticwebapp.config.json is too high or the service is not available. There should be no dependency on an online resource to be available for local development. From the logs it seems like it should continue to work without validation, but it currently doesn't.

Logs:

[swa] network timeout at: https://json.schemastore.org/staticwebapp.config.json
[swa] ✖ Failed to load staticwebapp.config.json schema. Continuing without validation!
[swa] node "C:\Users\USER\AppData\Local\pnpm\global\5\.pnpm\@[email protected]\node_modules\@azure\static-web-apps-cli\dist\msha\server.js" exited with code 0
--> Sending SIGTERM to other processes..
[dataApi] cd "C:\repos\APP\data-api" && "C:\Users\USER\.swa\dataApiBuilder\0.9.7\Microsoft.DataApiBuilder.exe" start -c staticwebapp.database.config.json --no-https-redirect exited with code 1
--> Sending SIGTERM to other processes..
[run] cd "C:\repos\APP\app" && pnpm dev exited with code 1
✖ SWA emulator stopped because the --run command exited with code 1.

My suggestion would be to increase the timeout for the request and to fix the bug that stops the CLI from working without validation.

itpropro avatar Mar 04 '24 03:03 itpropro

Same problem

JohnMarsing avatar Mar 06 '24 15:03 JohnMarsing