@nativescript/vite: native dev drops user virtual CSS imports and serves their CSS raw
Mantenedores costumam responder em até 3 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript, vite
Direção de pesquisa
Start with packages/vite/hmr/helpers/ast-normalizer.ts and trace how virtual module imports are filtered, then inspect the native dev-server handling for /ns/m/@id/__x00__virtual:bamboo.css. Reproduce the normalizer case from the issue and compare its output with /src/main.ts and /ns/m/src/main.ts. Done means the virtual stylesheet import is preserved and its request returns a native CSS registration module; add the described regression coverage alongside ordinary file CSS and CSS HMR.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Native dev drops import 'virtual:bamboo.css', leaving generated component styles unloaded and the app layout broken.
There are two parts to the failure: the import disappears, and requesting the stylesheet directly returns raw CSS instead of a native CSS registration module.
Reproduction and observed behavior
With the app importing virtual:bamboo.css, compare these dev-server responses:
| Request | Response |
|---|---|
/src/main.ts |
Includes import "/@id/__x00__virtual:bamboo.css"; |
/ns/m/src/main.ts |
Bamboo import is missing; ordinary file CSS imports remain |
/ns/m/@id/__x00__virtual:bamboo.css |
HTTP 200 with raw CSS, including generated rules and @layer xplat.reset, xplat.base, xplat.tokens, xplat.utilities; |
These were checked against the running server at http://127.0.0.1:5173.
The installed astNormalizeModuleImportsAndHelpers also reproduces the removal independently:
// Input
import "/@id/__x00__virtual:bamboo.css";
export const mounted = true;
// Output
/* [ast-normalized] */
export const mounted = true;
In ast-normalizer.ts, isViteVirtual matches null/__x00__ IDs except the OXC helper exemption, and the import visitor removes them. The same filtering is present on upstream main by source inspection.
Expected behavior
Preserve user virtual stylesheet imports and pass their CSS through native adaptation/registration. Preserving the import alone will not fix the raw-CSS response. Keep filtering specific to unsupported browser helpers.
A regression test should load a plugin-provided virtual stylesheet that sizes a native view, alongside ordinary file CSS and CSS HMR coverage.
Environment and limits
@nativescript/vite8.0.17, with Octane Xplat's canonical dependency patch- Vite 8.3.0;
@nativescript/core9.1.3; Android runtime/CLI 9.1.1 - Octane Xplat 0.15.0 (
e3545c95); Bamboo 1.56.2; macOS; pnpm
Verified in Android HTTP dev and with the installed normalizer. A clean unpatched NativeScript app and iOS HTTP dev have not been tested. No workaround has been applied.
Supporting layout measurements
Android's last laid-out hierarchy had a roughly 698 dp wide bottom bar (declared maximum 353 dp) at the top, with SVGs around 233×82 dp (declared 31×36 and 54×54 dp).
These came from 72 native views via adb shell dumpsys activity <app-id>, at 520 dpi (3.25 px/dp). The activity was backgrounded/stopped, and component mapping was inferred from tree structure/source order. The HTTP responses and normalizer reproduction above are the primary evidence.
A bundled Debug build on iPhone 18 Pro / iOS 27 has the expected 31×36 and 54×54 pt icon sizes. This is a different platform and serving mode; it does not establish that the HTTP-dev failure is Android-specific. Measurements used native bounds without screenshots or text/input values.
Related: #11472 concerns ordinary workspace CSS and __vite__updateStyle; #11461 concerns core cascade layers. Here, the stylesheet fails to reach native registration first.
- Linguagem predominante
- TypeScript
- Estrelas
- 25.7k
- Forks
- 1.7k
- Merge médio
- 4d 14h
- PRs com merge (30d)
- 53
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NativeScript/NativeScript
-
bug css
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
NativeScript/NativeScript#11525 ·
Mantenedores costumam responder em até 3 dias
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 69/100
NativeScript/NativeScript#11591 ·
Mantenedores costumam responder em até 3 dias
-
[iOS 26] Inset Frame cannot start native content Back with default navigationTalvez já em andamento @rafaelaugustos assumiu há 7 dias. Abertabug-pending-triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
NativeScript/NativeScript#11589 ·
Mantenedores costumam responder em até 3 dias
-
iOS: prebuilt Frame tree with inherited CSS direction triggers UIKit targetNode assertionTalvez já em andamento @rafaelaugustos assumiu há 8 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
NativeScript/NativeScript#11586 ·
Mantenedores costumam responder em até 3 dias
-
[Android] After exiting with Back, reopening the app in the same process never fires launch again (9.1 regression, Angular apps stay dead and unstyled)Talvez já em andamento @anjak03 assumiu há 10 dias. Abertabug os: android
Dificuldade 4/5 1-2 dias Facilidade para iniciantes 56/100
NativeScript/NativeScript#11572 ·
Mantenedores costumam responder em até 3 dias
Todas as issues de NativeScript/NativeScript
Issues semelhantes
-
🐛 bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
LibreChat-AI/LibreChat#17733 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
TypeStrong/typedoc#3150 ·
-
accessibility bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
Normalize image-source MIME types before SVG dispatchTalvez já em andamento @HarsH-1877 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
tscircuit/image-utils#58 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 2 dias