Turn off HTTPS in Vite dev server in Connect #47849
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After one of the vite or electron-vite updates,
pnpm start-term
started showing a blank window. Opening the dev tools revealed that the browser failed to load some individual source files with errorERR_HTTP2_PROTOCOL_ERROR
. The workaround was toCmd+R
, sometimes multiple times.Vite's has a bunch of issues about this, but they've all been closed. We tried adjusting a couple of Vite settings, but none of that helped (further increasing
maxSessionMemory
,server.warmup
,server.fs.cachedChecks
). Fortunately, it seems that turning off HTTPS for the dev server does the trick.AFAIK the Web UI needs HTTPS in its dev server for
PROXY_TARGET
to work withpnpm start-teleport
. Connect does no such proxying, so having HTTPS enabled is not strictly necessary. For what it's worth, APIs such ascrypto.randomUUID
still work.Unlike in the Web UI, turning of HTTPS in development doesn't make the dev environment differ from the prod environment, as in a packaged app the frontend files are read from the disk rather than being returned by a server.