diff --git a/config/shield.ts b/config/shield.ts index cd057c4..3f37be4 100644 --- a/config/shield.ts +++ b/config/shield.ts @@ -32,6 +32,14 @@ const shieldConfig = defineConfig({ defaultSrc: [`'self'`], connectSrc: [`'self'`, ...devConnectSrc], scriptSrc: [`'self'`], + // Some client-side dependencies (e.g. Vite's HMR client / the Tuyau + // API client) spawn a Web Worker from a `blob:` URL built at + // runtime from already same-origin-loaded code. Without an explicit + // worker-src, browsers fall back to script-src ('self' only), which + // blocks the blob: worker outright — this was observed to break the + // dev HMR connection and leave the Vue app in an inconsistent state + // (lost TuyauProvider context after a failed hot reload). + workerSrc: [`'self'`, 'blob:'], styleSrc: [`'self'`, `'unsafe-inline'`, 'https://fonts.googleapis.com'], imgSrc: [`'self'`, 'data:', 'https://fr.pc-builder.io', 'https://www.google.com'], fontSrc: [`'self'`, 'data:', 'https://fonts.gstatic.com'],