pablo-abc / svelte-markdown

Markdown parser to svelte components
MIT License
341 stars 49 forks source link

Error importing svelte-markdown: "'Lexer' is not exported by node_modules/marked/lib/marked.umd.js, ..." #43

Open elimisteve opened 2 years ago

elimisteve commented 2 years ago
[!] Error: 'Lexer' is not exported by node_modules/marked/lib/marked.umd.js, imported by node_modules/svelte-markdown/src/markdown-parser.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/svelte-markdown/src/markdown-parser.js (1:9)
1: export { Lexer, Slugger } from 'marked'
            ^
2: 
3: import {
Error: 'Lexer' is not exported by node_modules/marked/lib/marked.umd.js, imported by node_modules/svelte-markdown/src/markdown-parser.js
...
pablo-abc commented 2 years ago

What is your build set up? It seems your setup is trying to import marked from the UMD build rather than the ESM build.

elimisteve commented 2 years ago

Svelte + Rollup

pablo-abc commented 2 years ago

Do you have a reproduction for this? This is not happening to me with 0.2.2 and Svelte's default template.

LilianaEverett commented 1 year ago

@pablo-abc, did you solve this issue?

pablo-abc commented 1 year ago

@LilianaEverett I never managed to reproduce this on my projects. Is this happening to you as well? Do you have a repo or something where I can see this happening?

graytonio commented 11 months ago

I know this is an old issue but I'm having the same problem using sveltekit and it only occurs if it tries to render it on the server for static generation or ssr.