Simplemde-markdown-editor: Cannot read property 'first' of undefined

Created on 8 Jun 2018  路  3Comments  路  Source: sparksuite/simplemde-markdown-editor

Error

simplemde.min.js:7 Uncaught TypeError: Cannot read property 'first' of undefined
    at new t (simplemde.min.js:7)
    at new e (simplemde.min.js:7)
    at e (simplemde.min.js:7)
    at Function.e.fromTextArea (simplemde.min.js:12)
    at B.render (simplemde.min.js:15)
    at new B (simplemde.min.js:14)
    at add:140

My Code

<script>
        var content = new SimpleMDE({ element: document.getElementById("topiccontent") });
    </script>

Most helpful comment

Fixed: Needed to use a Textarea only controls do not work

All 3 comments

Fixed: Needed to use a Textarea only controls do not work

Same here. Did you figure out a fix?

@repat It looks like the fix is the element argument to the SimpleMDE constructor should be a textarea element (as opposed to a div).

Is it worth putting a DOM-element type check in the SimpleMDE constructor to avoid confusion for new users? I'd be happy to submit a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garethrbrown picture garethrbrown  路  5Comments

pranavstark picture pranavstark  路  3Comments

libregeek picture libregeek  路  3Comments

prologic picture prologic  路  4Comments

nivv picture nivv  路  4Comments