new URL to @fs (unbundled memfs Volume error)Minimal vrowzer 0.1.2 host on Vite 8.1.5. The host is a shell; preview files are passed to ready({ files }), they are not this app.
Layout (this is what produces @fs):
.
├── host/ Vite `root` (index.html + main.js)
├── node_modules/ outside `root` → Vite serves as /@fs/...
├── package.json
└── vite.config.ts
This repo covers the unbundled Service Worker path only. optimizeDeps.exclude is required so Vite 8 can start (*.mjs?raw otherwise crashes the optimizer). There is no host plugin that rewrites vrowzer/dist/index.js.
pnpm install
pnpm dev
If you copied this folder into another pnpm workspace, use pnpm install --ignore-workspace.
Open http://localhost:5173/app/ (not /). @vrowzer/vite-plugin already sends COOP/COEP.
Page shows register() scriptURL like:
/app/@fs/<abs>/node_modules/.pnpm/.../vrowzer/dist/service-worker.ts
No sw=service_worker_file.
Console:
The requested module '.../memfs/lib/index.js' does not provide an export named 'Volume'
Failed to register a ServiceWorker ... ServiceWorker script evaluation failed
ready() throws or returns false.
register() scriptURL includes ?sw=service_worker_file (or &sw=service_worker_file). The SW is a single ESM bundle. ready() is true and the preview mounts.
base: '/app/' plus deps outside Vite root is the point. Playgrounds on Vite 5/6 with base: '/' and deps inside root keep the relative new URL and hide this.serviceWorkerEntry is set on purpose. It does not fix the @fs miss./* @vite-ignore */ on the source new URL is not the fix. Vite skips, Rolldown may still rewrite, and rewriteEntryUrls no longer matches the relative path.