[BEX] Frequent extension reopen happens when loading the unpacked extension #17777
Labels
bug/1-repro-available
A reproduction is available and needs to be confirmed.
flavour/quasar-cli-vite
kind/bug 🐞
mode/bex
Qv2 🔝
Quasar v2 issues
What happened?
Frequent extension reopen happens when loading the unpacked extension. The extension tab gets opened and closed many times.
What did you expect to happen?
The frequent extension reopen to not happen.
Reproduction URL
https://stackblitz.com/edit/quasarframework-stackblitz-templates-nrxckgh2?file=README.md
How to reproduce?
pnpm i
pnpm quasar dev -m bex -T chrome
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
BEX Mode
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
WebSocket connection to 'ws://localhost:9600/' failed: Error during WebSocket handshake: Unexpected response code: 400
Additional context
This is probably happening due to the change in Vite 6.0.9. Due to a security issue (GHSA-vg6x-rcgg-rjx6), Vite 6.0.9+ now requires a token to connect to the WebSocket endpoint.
Because Quasar BEX mode connects to the WS server on its own, this connection no longer successes.
quasar/app-vite/exports/bex/background.js
Line 48 in bd70884
The way to fix would be to pass
config.webSocketToken
as a query param (e.g.?token=${config.webSocketToken}
) when connecting to WS server.https://github.com/vitejs/vite/blob/9654348258eaa0883171533a2b74b4e2825f5fb6/packages/vite/src/node/config.ts#L610-L620
But ideally, it should not connect to the WebSocket server on its own and instead use
import.meta.hot
.The text was updated successfully, but these errors were encountered: