Simplemde-markdown-editor: Uncaught TypeError: Cannot read property 'first' of undefined @ simplemde.min.js:7

Created on 10 Jul 2016  路  5Comments  路  Source: sparksuite/simplemde-markdown-editor

I got this error'Uncaught TypeError: Cannot read property 'first' of undefined'. @ simplemde.min.js:7
Here is my code on demo.

<div id="MyID>
</div>

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

Is this bug or am I doing wrong?

question

Most helpful comment

The element with the ID needs to be a <textarea> to function properly.

All 5 comments

I don't think you have an element with the ID MyID

@WesCossick I am having this issue too. I have

<div id="message-editable"></div>

<script>
var simplemde = new SimpleMDE({ element: document.getElementById("message-editable") });
</script>

Any ideas? I can't figure out what's wrong.

The element with the ID needs to be a <textarea> to function properly.

I feel like the README should makes this more clear. After finding your response to the issue I see that the README shows it should be in a textarea, but if the example code was included then it would avoid a lot of confusion for people quickly trying to pick this up.

It's strange. I have it in one page working with div in another page I get this error.
And the div one is working more seamlessly with the server!

Was this page helpful?
1 / 5 - 1 ratings

Related issues

xJoeyv picture xJoeyv  路  3Comments

mbeckenbach picture mbeckenbach  路  4Comments

prologic picture prologic  路  3Comments

garethrbrown picture garethrbrown  路  5Comments

pranavstark picture pranavstark  路  3Comments