fix: resolve noVNC RFB constructor failure after Vite 8 upgrade (#5455)
Some checks are pending
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
LawyZheng 2026-04-10 17:41:17 +08:00 committed by GitHub
parent 688b010b72
commit fd66b105b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,9 @@
import RFB from "@novnc/novnc/lib/rfb.js";
// @novnc/novnc is CJS with __esModule marker. Vite 8 (Rollup 5) changed
// CJS interop so the default import may be the namespace object instead of
// exports.default. This guard works across bundler versions.
import _RFB from "@novnc/novnc/lib/rfb.js";
type RFB = _RFB;
const RFB = (_RFB as typeof _RFB & { default?: typeof _RFB }).default ?? _RFB;
import { ExitIcon, HandIcon, InfoCircledIcon } from "@radix-ui/react-icons";
import { useEffect, useState, useRef, useCallback } from "react";
import { useQuery } from "@tanstack/react-query";