FrontEnd Certification Marked Text error

Tell us what’s happening:
I am stuck on the second challenge of the Frontend Certification Project. Bellow you can see my code. The two lines 51 and 68 when not commented make all my render disappear. Can anyone help me?

Your code so far
Code Pen page: https://codepen.io/belaguarino/pen/dyVRmPb

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36

Challenge: Build a Markdown Previewer

Link to the challenge:

  1. Look in the browser console Uncaught TypeError: marked is not a function

  2. Check the docs on which method you should be using marked.parse

FYI, The library had a major version update with breaking changes, check the release note.

react-dom.production.min.js:177 Uncaught TypeError: marked is not a function
at Markdown.render
I tried deleting and adding again but it did not work.

Did you check the docs and the release note?

  • When using marked in a script tag use marked.parse(...) instead of marked(...)

Yeah, now it works because of the .parse. Thanks.

1 Like

No problem. I would suggest you take this as a learning experience.

  1. Always look in the console (don’t use the Codepen console).

  2. Always read the docs.

Happy coding,

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