You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vite: workspace CSS imports served to device with __vite__updateStyle (undefined at runtime) #11472
Runtime error in @nativescript/vite (observed on 8.0.11, same code on main).
Description
In hmr/server/websocket-ns-m.ts the .css branch compiles via sharedTransformRequest(${spec}?inline), where spec is the root-relative URL (e.g. /packages/ui/src/theme/tokens.css). That path only resolves when the file lives under Vite's configured root. In a monorepo where shared packages live outside the app root, the ?inline transform misses, the branch falls through, and the device receives Vite's web CSS module which calls __vite__updateStyle — a helper that doesn't exist on NativeScript:
TypeError: undefined is not a function — __vite__updateStyle(...)
Observed with a workspace layout like apps/native (vite root) + packages/ui (shared package whose tokens.css is imported by the app entry).
Suggested fix
Resolve the specifier to its /@fs/<abs> form (or the real file path) before appending ?inline, so the transform works regardless of which root the file sits under. In our patched copy, routing the CSS branch through the same /@fs resolution the module path uses fixed boot; note the ?inline output shape also needs the export default "<css>" regex to match whatever the current Vite version emits.
Environment: @nativescript/vite 8.0.11, Vite 8.3, iOS simulator, pnpm monorepo.
Activity
aleclarson commentedon Sep 28, 2026
Minimal reproduction: https://github.com/aleclarson/repro/tree/nativescript-11472 — a single Node script (
npm install && node repro.mjs) that exercises the exact upstream function/code path and prints the failure.