From d5bbe799ce819f20615ab855c76e9273311e2a7c Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Wed, 5 Aug 2026 14:23:46 +0200 Subject: [PATCH] Fix prosekit-editor.js: remove bare CSS imports that aborted the whole module import 'x.css' with a real text/css response isn't a valid JS module without a `with { type: 'css' }` assertion browsers don't uniformly support - it threw and prevented mountEditor from ever being defined, so the prosekit container just stayed empty. ensureStylesheet() (a tag, already written) is the actual CSS-loading path; the top-level imports were dead-wrong duplicates of it. --- prosekit-editor.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prosekit-editor.js b/prosekit-editor.js index 60d2561..11662ca 100644 --- a/prosekit-editor.js +++ b/prosekit-editor.js @@ -19,8 +19,14 @@ // precise `definePasteHandler` callback signature. Everything else here // mirrors prosekit's own documented examples closely. -import 'https://esm.sh/prosekit/basic/style.css' -import 'https://esm.sh/prosekit/basic/typography.css' +// CSS is loaded via ensureStylesheet() (a tag) inside +// mountEditor below, not a JS import - esm.sh serves these paths as a +// redirect to a real text/css response, which a plain `import 'x.css'` +// (no `with { type: 'css' }` assertion, which browsers don't uniformly +// support yet) fails to load as a module and aborts this entire file's +// evaluation. Confirmed the hard way: this is exactly what silently +// broke the first deploy of this file - mountEditor never got defined, +// so the visible editor container just stayed empty. import { defineBasicExtension } from 'https://esm.sh/prosekit/basic' import { createEditor,