Azure / Azure/static-web-apps-cli

Sveltekit build result works fine in cloud, fails with swa cli

Offen
#945 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
668
Forks
156
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).
```
demo % npx swa --version
2.0.4
```

**Are you accessing the CLI from the default port `:4280` ?**

- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [X] Yes, I am accessing the CLI from port `:4280`

> Make sure you are accessing the URL printed in the console when running `swa start`!

- [X] **ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**
The build result of the SvelteKit app with [svelte-adapter-azure-swa](https://github.com/geoffrich/svelte-adapter-azure-swa) deployed to the azure swa cloud works fine.

https://polite-desert-00b80111e.2.azurestaticapps.net/

Tests (automated and manual) fail with swa cli.

**To Reproduce**
This branch is minimally different to main to start swa cli for the demo app
```
git clone -b feat/update git@github.com:ktarmyshov/svelte-adapter-azure-swa.git
cd svelte-adapter-azure-swa
npm ci
npm pack
cd demo
npm ci
npx playwright install
npm run test:swa
```
Manual:
- run `npm run swa`
- Navigate to http://localhost:4280/ - works
- Click to "about" - works
- Click to "sverdle" - works
- Navigate to http://localhost:4280/about or click refresh in "about" page - 404
- Navigate to http://localhost:4280/sverdle or click refresh in "sverdle" page - too many redirects

**Expected behavior**
Should work same as azure cloud - should not fail.

**Screenshots**
N/A

**Desktop (please complete the following information):**

- OS: Mac OS
- latest 15.3.1

**Additional context**
Latest deploy job

https://github.com/geoffrich/svelte-adapter-azure-swa/actions/runs/13660215225/job/38189418604

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Reproduktion der Demo: Führe `npm ci`, `npm pack` aus, installiere die Abhängigkeiten in `demo` und führe `npm run test:swa` aus; führe anschließend `npm run swa` aus und überprüfe die aufgeführten Routen auf Port 4280. Vergleiche die Navigation und das Verhalten beim Aktualisieren mit dem bereitgestellten Ergebnis von Azure Static Web Apps. Als erledigt gilt es, wenn `/about` und `/sverdle` geladen und aktualisiert werden können, ohne einen 404-Fehler oder eine Weiterleitungsschleife.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, playwright, typescript
Bereich
cli, cloud, testing
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.