You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from #1615 / PR #1768. While adding the headless-browser boot smoke, we measured what the pinned vite@8.0.0 actually does when a Node built-in reaches the browser graph:
A node:* (or bare builtin via a dep's browser field) import is externalized at build time with a warning (plugin rolldown:vite-resolve: Module "node:fs" has been externalized for browser compatibility), and the build still succeeds, shipping a silent module.exports = {} stub.
CI does not fail on that warning, so nothing upstream of the runtime gates it.
CASE 2 (the stub is imported but never called): ships a harmless {} and is invisible to the browser smoke by design — nothing catches it.
Proposal
Make vite build treat that specific browser-externalization warning as an error (e.g. via an onwarn/onLog hook in clients/web/vite.config.ts, or Rolldown's warning-to-error mechanism). That would:
move CASE 1 detection upstream of the smoke into npm run build / validate (a Node built-in in the browser graph fails the build instead of shipping a broken bundle), and
additionally catch CASE 2, which the runtime smoke cannot see.
The browser smoke stays valuable as the runtime backstop (it catches crashes the build can't reason about), but the build gate is the cheaper, earlier, more complete catch for the externalization class specifically.
Notes
Verify the exact warning code/shape emitted by the pinned Vite (it differs across 8.0.x → 8.1.x — 8.1.5 reportedly fails the build outright, 8.0.0 warns), and key the gate off something stable.
Keep it scoped to browser-target builds; the Node runner build legitimately uses built-ins.
Motivation
Follow-up from #1615 / PR #1768. While adding the headless-browser boot smoke, we measured what the pinned vite@8.0.0 actually does when a Node built-in reaches the browser graph:
node:*(or bare builtin via a dep'sbrowserfield) import is externalized at build time with a warning (plugin rolldown:vite-resolve:Module "node:fs" has been externalized for browser compatibility), and the build still succeeds, shipping a silentmodule.exports = {}stub.Consequences:
smoke:web:browser(CI: add a headless-browser boot smoke for the web client #1615). That smoke is currently the only gate for this shape.{}and is invisible to the browser smoke by design — nothing catches it.Proposal
Make
vite buildtreat that specific browser-externalization warning as an error (e.g. via anonwarn/onLoghook inclients/web/vite.config.ts, or Rolldown's warning-to-error mechanism). That would:npm run build/validate(a Node built-in in the browser graph fails the build instead of shipping a broken bundle), andThe browser smoke stays valuable as the runtime backstop (it catches crashes the build can't reason about), but the build gate is the cheaper, earlier, more complete catch for the externalization class specifically.
Notes
Discovered during the review of PR #1768.