From 88585a29bf545a0fe16f65f2c33dd7835d84371b Mon Sep 17 00:00:00 2001 From: robot Date: Wed, 12 Aug 2026 03:13:07 +0000 Subject: [PATCH] fix: disable modulePreload polyfill for Chrome MV3 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vite was injecting modulepreload-polyfill.js into the built output, which Chrome rejected at runtime with: 'A preload for .../modulepreload-polyfill.js is found, but is not used because it is a cross-world extension resource mismatch.' Disabling the polyfill (extension context does not need it — Chrome 110+ supports bare ESM natively) removes the offending chunk entirely. --- vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index a6915db..2f72e13 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -49,8 +49,12 @@ export default defineConfig({ }, ], build: { + target: 'chrome110', outDir: '../dist', emptyOutDir: true, + modulePreload: { + polyfill: false, + }, rollupOptions: { input: { background: resolve(__dirname, 'src/background/background.js'),