Fix prosekit-editor.js: remove bare CSS imports that aborted the whole module
Deploy / deploy (push) Successful in 28s
Deploy / deploy (push) Successful in 28s
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
<link> tag, already written) is the actual CSS-loading path; the
top-level imports were dead-wrong duplicates of it.
This commit is contained in:
+8
-2
@@ -19,8 +19,14 @@
|
|||||||
// precise `definePasteHandler` callback signature. Everything else here
|
// precise `definePasteHandler` callback signature. Everything else here
|
||||||
// mirrors prosekit's own documented examples closely.
|
// mirrors prosekit's own documented examples closely.
|
||||||
|
|
||||||
import 'https://esm.sh/prosekit/basic/style.css'
|
// CSS is loaded via ensureStylesheet() (a <link> tag) inside
|
||||||
import 'https://esm.sh/prosekit/basic/typography.css'
|
// 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 { defineBasicExtension } from 'https://esm.sh/prosekit/basic'
|
||||||
import {
|
import {
|
||||||
createEditor,
|
createEditor,
|
||||||
|
|||||||
Reference in New Issue
Block a user