Skip to content

Upgrade vite to 6.0.11#51356

Merged
avatus merged 2 commits intomasterfrom
avatus/vite
Jan 22, 2025
Merged

Upgrade vite to 6.0.11#51356
avatus merged 2 commits intomasterfrom
avatus/vite

Conversation

@avatus
Copy link
Copy Markdown
Contributor

@avatus avatus commented Jan 22, 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.

@ryanclark , i didn't have any issues with localhost and my non-localhost domain that I typically run so I didn't need to update allowedHosts, can you confirm?

edit: confirmed we had a few users whos HMR didnt work without allowedHosts so Ive updated it

@avatus avatus added the no-changelog Indicates that a PR does not require a changelog entry label Jan 22, 2025
@avatus avatus requested a review from ryanclark January 22, 2025 14:55
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from rosstimothy January 22, 2025 15:34
@avatus
Copy link
Copy Markdown
Contributor Author

avatus commented Jan 22, 2025

Waiting for gravitational/shared-workflows#310 before I can merge

Comment thread web/packages/build/vite/config.ts Outdated
const config: UserConfig = {
clearScreen: false,
server: {
allowedHosts: true,
Copy link
Copy Markdown
Member

@ravicious ravicious Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, '.'],
         },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch works for me, i appreciate the improvement. applied

@ravicious
Copy link
Copy Markdown
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.
@ravicious
Copy link
Copy Markdown
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.

@avatus avatus enabled auto-merge January 22, 2025 16:49
@avatus avatus added this pull request to the merge queue Jan 22, 2025
Merged via the queue into master with commit 8925492 Jan 22, 2025
@avatus avatus deleted the avatus/vite branch January 22, 2025 17:30
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants