Adding markdown mode error

Hey guys, I am trying to make markdown editor using React and Codemirror. Default view (with any language mode) works fine, however when I try to import and add markdown module, I am constantly getting this error.


I have tried to add any language module and every time I get the same error. Still can’t figure out how to fix it. Need some help guys :slight_smile:
Thank you!

Are you maybe loading the markdown mode before the main library? createCommonjsModule in the stack trace suggests you are using some kind of module loader. Which one?

I am using Snowpack here

I was under the impression that Showpack targets ES modules, which CodeMirror doesn’t yet provide. Maybe it’s automatically converting the UMD code to ES modules and something goes wrong there. I don’t really have enough experience with Snowpack to say much here.

1 Like

Thank you for response. I will look into that.

1 Like