Wysiwyg-editor: Uncaught TypeError: b.opts.codeMirror.fromTextArea is not a function

Created on 19 Oct 2017  路  6Comments  路  Source: froala/wysiwyg-editor

We're running froala 2.7.0 with codemirror 5.30.0. Tested in Chrome, we get the above error when trying to switch to code view. Any idea what could cause this? We're not explicitly calling this anywhere.

documentation

Most helpful comment

This should be changed in the docs.

All 6 comments

It looks like if we set the codeMirror option to reference codeMirror, i.e., {codeMirror: window.CodeMirror} this seems to work, as oppose to this being set to true. Is that right?

@btmdave that is right. The option was changed and now you should use codeMirror: window.CodeMirror.

This should be changed in the docs.

The docs should definitely be updated.

Code view would work for me after clicking it twice, but the error that I got from using "codeView: true" broke the code beautifier.

Here is an example page where the JS Fiddle isn't working: https://www.froala.com/wysiwyg-editor/examples/code-mirror

Here is where it is listed incorrectly in the docs: https://www.froala.com/wysiwyg-editor/docs/options#codeMirror

@davidrichied we'll update it shortly. Thanks for pointing it out.

Removing the codeMirror option from the object resolves the issue for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

homoky picture homoky  路  3Comments

adilsonb picture adilsonb  路  3Comments

Fandangi picture Fandangi  路  3Comments

george-norris-salesforce picture george-norris-salesforce  路  4Comments

bbugh picture bbugh  路  3Comments