sparksuite / simplemde-markdown-editor

A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://simplemde.com
MIT License
9.79k stars 1.12k forks source link

Fix problems with `marked@4.x` #825

Open staszek998 opened 2 years ago

staszek998 commented 2 years ago

The 4.0.0 release of the marked package contains a breaking change that - guess what - breaks the SimpleMDE's script. The main change is that the marked package does NOT provide a default export anymore.

For more information please see the release notes for marked@4.0.0.

staszek998 commented 2 years ago

@WesCossick, @sparksuite-bot, it would be great if you could look into this 🙂

marui325 commented 2 years ago

'simplemde.js?ebfb:1417 Uncaught TypeError: marked is not a function' I have the same problem and I solve it by overwriting the installation(npm install marked@3.0.8), but I still hope to fix it by merging the branch or modifying the import mode in code.

aptkingston commented 2 years ago

I can't believe all the dependencies in package.json are specified as complete wildcards *. That's absolutely shocking. It means issues like this will continue to happen because any major, breaking changes in any dependencies will be happily pulled in when installing this package.

The project looks dead anyway since it's been 6 years since any updates. Such a shame, it looks like a wonderful editor.

staszek998 commented 2 years ago

Indeed @aptkingston, the project is dead, not updated for a pretty long time... It's somehow comforting, that fixing the marked dependency on the ^3.0.8 version solves the problem efficiently.

BTW: You could be interested in the resolutions field in the Yarn's configuration.

aptkingston commented 2 years ago

Yea that definitely solves the problem in this case. I actually found https://github.com/Ionaru/easy-markdown-editor which is a fork of this project which is maintained and actually works! So I'm using that now and it's great.

staszek998 commented 2 years ago

Thank's for the griff, @aptkingston! I didn't ever see this package before, don't know how! Thank you!