Marked is not a function... again

Markdown Editor (codepen.io)

Currently trying to make a markdown editor for the React.js projects.

But I’m getting the error ‘Marked is not a function’

I installed marked and prism. I deleted the libraries and installed them again. But it’s still not working.

Read the marked.js docs.

For version 4 of marked.js:

If you use a script to load it (which is what the Codpen JS settings do), you have to use marked.parse()

If you use import { marked } from "https://cdn.skypack.dev/marked@4.0.16"; you can use it with or without .parse()

https://github.com/markedjs/marked/releases/tag/v4.0.0
https://marked.js.org/#usage
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.