pablo-abc / svelte-markdown

Markdown parser to svelte components
MIT License
357 stars 50 forks source link

No export named "Slugger", Vercel/SvelteKiit + SSR #92

Open cybrejon opened 6 months ago

cybrejon commented 6 months ago
file:///var/task/.svelte-kit/output/server/entries/pages/shikigami/_slug_/guide/_slug_/_page.svelte.js:2
import { Slugger, Lexer } from "marked";
         ^^^^^^^
SyntaxError: The requested module 'marked' does not provide an export named 'Slugger'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async Module.component (file:///var/task/.svelte-kit/output/server/nodes/9.js:5:59)
    at async Promise.all (index 1)
    at async render_response (file:///var/task/.svelte-kit/output/server/index.js:1308:21)
    at async render_page (file:///var/task/.svelte-kit/output/server/index.js:2171:12)
    at async resolve2 (file:///var/task/.svelte-kit/output/server/index.js:2795:24)
    at async respond (file:///var/task/.svelte-kit/output/server/index.js:2686:22)
    at async Server.default (file:///var/task/.svelte-kit/vercel-tmp/index.js:40:3)

marked removed slugger since version 8 https://github.com/markedjs/marked/pull/2984/commits/c83fbb40aebe9605875e01cd7468033ee881ffeb

magick93 commented 4 months ago

Same thing on cloudflare pages.

justin-pierce commented 3 months ago

Had same issue, not sure this is a svelte-markdown issue.

I had a newer version of marked as a dependency from testing it before moving to svelte-markdown. Just removed that so svelte-markdown grabs the older version defined in its dependencies and it seems to fix it.

gavinmcfarland commented 2 weeks ago

I had the same issue, I added the following to my package.json.

"resolutions": {
    "marked": "^14.1.3"
},