Skip to content

Commit b6bccd0

Browse files
carpe-diemclaude
andauthored
fix(extension): stop emitting modulepreload hints Chrome rejects (#113)
* docs(extension): complete the v1.3.5 changelog Six of the eight user-visible changes since v1.3.4 had no entry, including Reports — a whole feature — and the 21-day habit challenges. The section only listed the two sync items added while writing them today, because entries were being appended as work landed rather than reconciled against what had actually shipped. Everything from #61 through #91 predates that habit and slipped through. Added: Reports, habit challenges and real streaks, the challengeLengthDays clear that never travelled, the description/links clear that never travelled, the Google sign-in popup dying mid-OAuth, and backups carrying sync state. Left out deliberately: #88's type-error cleanup and the shared wire-contract refactor, which change nothing a user can see. The clear-propagation *bug* that refactor fixed is listed; the refactor itself isn't. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(extension): stop emitting modulepreload hints Chrome rejects A freshly loaded extension lists five errors on its own page: A preload for 'chrome-extension://…/assets/index-….js' is found, but is not used because it is a cross-world extension resource mismatch. One per shared chunk. Vite emits <link rel="modulepreload" crossorigin> for each, and Chrome refuses them under a chrome-extension:// origin. Nothing was broken by it — the hints are discarded and the modules still load through the import graph, which is why the popup has always worked. But a page of red on a newly installed extension is its own problem, and it would have been the first thing a reviewer saw. The hint buys nothing here regardless: it exists to start fetches earlier over a network, and these files are already on disk. Pre-existing, not new — the published 1.3.4 builds the same way. Worth fixing before 1.3.5 goes out rather than after. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 23d85f9 commit b6bccd0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

extension/vite.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ export default defineConfig({
3838
build: {
3939
outDir: resolve(__dirname, 'dist'),
4040
emptyOutDir: true,
41+
// Vite emits <link rel="modulepreload" crossorigin> for every shared
42+
// chunk. Chrome rejects each one under a chrome-extension:// origin —
43+
// "cross-world extension resource mismatch" — and lists them all as
44+
// errors on the extension's own page. Nothing breaks: the hints are
45+
// discarded and the modules still load through the import graph. But
46+
// a page of red on a freshly installed extension is its own problem.
47+
//
48+
// The hint buys nothing here anyway. It exists to start fetches earlier
49+
// over a network; these files are already on disk.
50+
modulePreload: false,
4151
rollupOptions: {
4252
input: {
4353
popup: resolve(root, 'popup/index.html'),

0 commit comments

Comments
 (0)