Skip to content
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

fix(hmr): infer hmr hostname on client #980

Merged
merged 1 commit into from
Nov 2, 2020
Merged

fix(hmr): infer hmr hostname on client #980

merged 1 commit into from
Nov 2, 2020

Conversation

stevenpwaters
Copy link
Contributor

Github/VS Codespaces don't forward WebSocket requests so the HMR hostname must be manually configured in vite config like so:

hmr: {
  port: 443,
  hostname: '{uuid}-{port}.apps.codespaces.githubusercontent.com'
}

New codespaces get a different UUID so need to be reconfigured each time. This PR infers hostname on the client rather than server by default so codespace users only need to specify the WS port (443) in vite config.

This is the same behaviour as prior to bec6b3c. Use cases such as #918 can now be addressed by defining a hostname in the config as above (introduced subsequently with b753478); these users are less inconvenienced as their backend URL is unlikely to change.

@stevenpwaters stevenpwaters marked this pull request as ready for review October 30, 2020 16:45
@yyx990803 yyx990803 merged commit 858b2bf into vitejs:master Nov 2, 2020
@stevenpwaters stevenpwaters deleted the fix-codespaces branch November 2, 2020 17:03
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 this pull request may close these issues.

2 participants