Merged
Conversation
ryanclark
approved these changes
Jan 22, 2025
flyinghermit
approved these changes
Jan 22, 2025
Contributor
Author
|
Waiting for gravitational/shared-workflows#310 before I can merge |
ravicious
reviewed
Jan 22, 2025
| const config: UserConfig = { | ||
| clearScreen: false, | ||
| server: { | ||
| allowedHosts: true, |
Member
There was a problem hiding this comment.
I wonder if we could use the target variable instead of allowing all hosts?
I confirmed that HMR doesn't work when I comment out allowedHosts completely and that it still works with this solution in place.
diff --git a/web/packages/build/vite/config.ts b/web/packages/build/vite/config.ts
index e2e9db9f1d..9521631ddf 100644
--- a/web/packages/build/vite/config.ts
+++ b/web/packages/build/vite/config.ts
@@ -54,10 +54,15 @@ export function createViteConfig(
}
}
+ const targetHostname =
+ target !== DEFAULT_PROXY_TARGET
+ ? new URL(`http://${target}`).hostname
+ : undefined;
+
const config: UserConfig = {
clearScreen: false,
server: {
- allowedHosts: true,
+ allowedHosts: targetHostname ? [`.${targetHostname}`] : [],
fs: {
allow: [rootDirectory, '.'],
},
Contributor
Author
There was a problem hiding this comment.
patch works for me, i appreciate the improvement. applied
Member
|
Vite was updated to v6 quite recently actually. We made the decision to update it to v6 without waiting for electron-vite. #50617 (review) |
This will upgrade vite. I'm getting an "unmet dep" warning for electron-vite saying it expects a max of vite 5, however we are currently on the latest version of electron-vite so I don't think there is much we can do here. We have already been running vite 6+ for months now tho and electron-vite has been working fine so I think its ok to ignore for now.
Member
|
BTW, I just got a notification an hour ago under an electron-vite issue that the beta of v3 is out which updates Vite compatibility to v6. |
carloscastrojumo
pushed a commit
to carloscastrojumo/teleport
that referenced
this pull request
Feb 19, 2025
This will upgrade vite. I'm getting an "unmet dep" warning for electron-vite saying it expects a max of vite 5, however we are currently on the latest version of electron-vite so I don't think there is much we can do here. We have already been running vite 6+ for months now tho and electron-vite has been working fine so I think its ok to ignore for now.
ravicious
pushed a commit
that referenced
this pull request
Feb 6, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
* Bump the electron group across 1 directory with 4 updates * Bump the electron group across 1 directory with 4 updates Bumps the electron group with 4 updates in the / directory: [node-pty](https://github.com/microsoft/node-pty), [electron](https://github.com/electron/electron), [electron-updater](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-updater) and [electron-vite](https://github.com/alex8088/electron-vite). Updates `node-pty` from 1.1.0-beta35 to 1.1.0 - [Release notes](https://github.com/microsoft/node-pty/releases) - [Commits](microsoft/node-pty@v1.1.0-beta35...v1.1.0) Updates `electron` from 39.2.2 to 40.1.0 - [Release notes](https://github.com/electron/electron/releases) - [Commits](electron/electron@v39.2.2...v40.1.0) Updates `electron-updater` from 6.7.0 to 6.7.3 - [Release notes](https://github.com/electron-userland/electron-builder/releases) - [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/CHANGELOG.md) - [Commits](https://github.com/electron-userland/electron-builder/commits/electron-updater@6.7.3/packages/electron-updater) Updates `electron-vite` from 4.0.1 to 5.0.0 - [Release notes](https://github.com/alex8088/electron-vite/releases) - [Changelog](https://github.com/alex8088/electron-vite/blob/master/CHANGELOG.md) - [Commits](alex8088/electron-vite@v4.0.1...v5.0.0) --- updated-dependencies: - dependency-name: node-pty dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: electron - dependency-name: electron dependency-version: 40.1.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: electron - dependency-name: electron-updater dependency-version: 6.7.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: electron - dependency-name: electron-vite dependency-version: 5.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: electron ... Signed-off-by: dependabot[bot] <support@github.com> * Revert unnecessary updates * Bump Node.js to 24 * Add node-pty prebuilds to `x64ArchFiles` * Update node-pty to 1.2.0-beta.10 * Add fix for Wayland --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com> Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com> * Update Vite & related packages to latest * Upgrade vite to 6.0.11 (#51356) * Allow custom domains in Vite's allowedHosts (#51395) * Allow custom domains in Vite's allowedHosts * Allow both VITE_HOST and the target to be allowedHosts * Use exact dep versions as v18 I think it'd have been enough to update `@vitejs/plugin-react-swc` to 3.9.0, but just to be sure I changed the versions to match v18. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com> Co-authored-by: Ryan Clark <ryan.clark@goteleport.com> Co-authored-by: Michael <michael.myers@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This will upgrade vite. I'm getting an "unmet dep" warning for electron-vite saying it expects a max of vite 5, however we are currently on the latest version of electron-vite so I don't think there is much we can do here. We have already been running vite 6+ for months now tho and electron-vite has been working fine so I think its ok to ignore for now.
@ryanclark , i didn't have any issues with
localhostand my non-localhost domain that I typically run so I didn't need to updateallowedHosts, can you confirm?edit: confirmed we had a few users whos HMR didnt work without
allowedHostsso Ive updated it