GeezerVison is showing github.com — fix(vite): resolve workspace css specs to /@fs before ?inline transform by aleclarson · Pull Request #11474 · NativeScript/NativeScript
Conversation
PR Checklist
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.
nx-cloud
Bot
commented
Sep 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pkg-pr-new
Bot
commented
Sep 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.