Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Dev manifest loses lazy CSS when imported before HTTP startup

Aperta
#414 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
build-system

Direzione di ricerca

Start with devManifestBridgeUrl() and the code that generates virtual:solid-manifest, and find where it falls back to the JS-only manifest when the bridge URL is null. Use the reproduction in the issue: create the server with Vite's createServer(), delay server.listen() until the manifest is requested, then fetch with Accept: text/html and check whether the lazy CSS is included. Done means the manifest resolves the bridge URL lazily, so the lazy CSS appears even when the manifest loads before listening, and it handles a port change or a server closed before listening.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With Nitro's Vite integration, the server runner can import virtual:solid-manifest before the HTTP server starts listening. devManifestBridgeUrl() returns null at that point, and the generated manifest keeps the JS-only fallback for the rest of the session.

The page renders successfully, but CSS imported by a lazy component is missing from the SSR response. The browser adds it during hydration, causing a visible layout change.

Reproduced with:

The relevant manifest code is unchanged in 3.0.0-next.50.

A small app is enough:

// src/App.tsx
import { lazy } from 'solid-js';

const Page = lazy(() => import('./Page.tsx'), undefined, 'src/Page.tsx');

export default function App() {
  return <Page />;
}
// src/Page.tsx
import './page.css';

export default function Page() {
  return <div class="bridge_probe">Nitro manifest probe</div>;
}
/* src/page.css */
.bridge_probe { font-size: 18px; }

Configure solid({ ssr: true, start: { devtools: false } }) and nitro({ serverEntry: false }).

To reproduce the startup ordering consistently, create the server through Vite's createServer() API and delay server.listen() until Nitro has requested virtual:solid-manifest. A preceding plugin's load hook can observe that request. Then start listening and fetch the page with Accept: text/html.

Actual result: HTTP 200, page content present, lazy CSS absent. Delaying the manifest load until the HTTP server is listening makes the same request include the CSS.

The bridge URL should remain usable when an external runner loads the manifest before the first request. The fix also needs to handle Vite choosing another port and closing the server before it starts listening.

Lingua principale
TypeScript
Stelle
522
Fork
72
Merge medio
1g 5h
PR unite (30g)
34

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid-vite-plugin

Tutte le issue di solidjs/solid-vite-plugin

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.