GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(vite): resolve workspace css specs to /@fs before ?inline transform by aleclarson · Pull Request #11474 · NativeScript/NativeScript

Conversation

@aleclarson

@aleclarson aleclarson commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • The PR title follows our guidelines.
  • Issue filed: vite: workspace CSS imports served to device with __vite__updateStyle (undefined at runtime) #11472
  • CLA signed.
  • All existing tests are passing — see testing note.
  • Tests for the changes are included — see testing note.

What is the current behavior?

The .css branch of the /ns/m route compiles the stylesheet via sharedTransformRequest(${spec}?inline), where spec is the workspace-root-relative URL emitted by the pipeline (e.g. /packages/ui/src/theme/tokens.css). A root-relative URL only resolves under Vite's configured root, so for a monorepo workspace file the transform is denied, the branch silently falls through, and the device receives Vite's DOM-oriented CSS module:

TypeError: undefined is not a function — __vite__updateStyle(...)

(boot fails; the helper doesn't exist on NativeScript)

What is the new behavior?

The CSS branch anchors spec to the real file via /@fs/<root>/<spec> (probing project root first, then the monorepo workspace root) before the ?inline transform — the same /@fs resolution the module pipeline below already uses. In a monorepo the inline compile now succeeds and the device gets export default "<css>" + the __NS_REGISTER_CSS__ bridge call.

Fixes #11472.

Testing note

This code sits in the dev-server route handler, above the unit-testable helper layer — a spec would need a running ViteDevServer with the NS plugin. Verified via a minimal standalone repro exercising the exact transform gap on [email protected]: https://github.com/aleclarson/repro/tree/nativescript-11472 — and end-to-end: this exact change (as a pnpm patch on 8.0.11) unblocked an HTTP-ESM dev boot that previously 404'd/fell through.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aleclarson
fix(vite): resolve workspace css specs to /@fs before ?inline transform
4eaf4c5
@nx-cloud

nx-cloud Bot commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 18ca85f

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 43s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-29 21:29:23 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11474
npm i https://pkg.pr.new/@nativescript/vite@11474
npm i https://pkg.pr.new/@nativescript/webpack@11474

commit: 18ca85f

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NathanWalker
refactor(vite): share /@fs spec anchoring between css and module routes
18ca85f
NathanWalker
NathanWalker approved these changes Sep 29, 2026
View reviewed changes
@NathanWalker
NathanWalker merged commit 2050379 into NativeScript:main Sep 29, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@NathanWalker NathanWalker NathanWalker approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

vite: workspace CSS imports served to device with __vite__updateStyle (undefined at runtime)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@aleclarson @NathanWalker
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.