Skip to content

SWA start is broken when using Vite and TypeScript #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
sinedied opened this issue May 13, 2025 · 0 comments · May be fixed by #957
Open
1 of 2 tasks

SWA start is broken when using Vite and TypeScript #956

sinedied opened this issue May 13, 2025 · 0 comments · May be fixed by #957

Comments

@sinedied
Copy link
Member

Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.

swa version: 2.0.6

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
  • Yes, I am accessing the CLI from port :4280

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

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

Describe the bug
When using latest Vite (>=6.3.5) dev server and a TypeScript project, SWA CLI fails to load through the dev proxy (:4280) while it work using the Vite dev server directly (:5173).

Image

The issue seems to that the MIME type is changed when going through the SWA proxy, changing from text/javascript to video/m2pt.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project folder, and run npm create vite@latest repro -- --template lit-ts
  2. cd repro && npm install && npm install -D @azure/static-web-apps-cli
  3. Add this swa-cli.config.json:
{
  "$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
  "configurations": {
    "registration-website": {
      "appLocation": ".",
      "run": "npm run dev",
      "appDevServerUrl": "http://localhost:5173"
    }
  }
}
  1. Run npx swa start

Expected behavior
Requests going through the proxy do not alter the MIME type

Desktop (please complete the following information):

  • OS: MacOS
  • Version 15.4.1 (24E263)
@sinedied sinedied linked a pull request May 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant