Markdown Previewer no longer works on Codepen

My code may not be the best (just realized that I should be using ternary operators to set classNames), but I can confirm that the page does work on my local machine. It used to work on codepen too, which is how I submitted the project with all tests passing. Now, it no longer does.

Codepen tells me that marked is not a function on line 106. But I don’t understand how to fix this. Especially since I’ve already added the external marked script and especially because it worked just fine before.

There’s few commented out imports at the top of file. Should they all be commented out?

Yeah. Those imports don’t work on codepen and only work on my local machine. Codepen allows you to simply add the external scripts as a workaround though (which is why I don’t need an import statement for React or ReactDOM)

Uncomment the following and it works
import {marked} from "https://cdn.skypack.dev/marked"

It’s line 5 in codepen’s JS editor

1 Like

That worked perfectly. Thank you!

Still though. I pretty much ignored this pen after I completed it. I have no idea why it suddenly stopped working initially.