fix(vite): resolve workspace css specs to /@fs before ?inline transform - #11474
Merged
NathanWalker merged 2 commits intoSep 29, 2026
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 18ca85f
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
NathanWalker
approved these changes
Sep 29, 2026
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.
PR Checklist
What is the current behavior?
The
.cssbranch of the/ns/mroute compiles the stylesheet viasharedTransformRequest(${spec}?inline), wherespecis 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 configuredroot, 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:(boot fails; the helper doesn't exist on NativeScript)
What is the new behavior?
The CSS branch anchors
specto the real file via/@fs/<root>/<spec>(probing project root first, then the monorepo workspace root) before the?inlinetransform — the same/@fsresolution the module pipeline below already uses. In a monorepo the inline compile now succeeds and the device getsexport 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
ViteDevServerwith the NS plugin. Verified via a minimal standalone repro exercising the exact transform gap onvite@8.3.0: 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.