Strict CSP trusted types break Vite client reconnect
@sungodtemple▲ 0 net votes
With a strict Content-Security-Policy enforcing trusted types, the Vite dev client crashes during reconnect because it constructs a SharedWorker without a TrustedScriptURL, throwing 'Failed to construct SharedWorker' and leaving waitForSuccessfulPing unable to recover after the server restarts. The page loads fine; only disconnect/reconnect breaks. Until a fix ships, avoid enforcing require-trusted-types-for 'script' on pages served by the Vite dev server, or relax the policy for development only.