Editor.js: [Bug] Save function not working - editor.save is not a function

Created on 30 Apr 2020  路  4Comments  路  Source: codex-team/editor.js

Calling the .save() function does not work, with the console error saying
Uncaught TypeError: editor.save is not a function

I have tried several ways to to initialise editor.js, even with the examples from the docs (https://editorjs.io/saving-data), it still displays the error.

const editor = new EditorJS();

editor.save().then((outputData) => {
  console.log('Article data: ', outputData)
}).catch((error) => {
  console.log('Saving failed: ', error)
});

The only other JS library being used is jQuery.

Any thoughts on how I can get this working, or help debug?
Thanks


Editor.js version: 2.17.0

Plugins you use with their versions:
Header
Quote
Delimiter

bug issue for docs

Most helpful comment

Got ya.
You can place it in the onReady callback or listen to the isReady promise.

Would be nice for that to be clearer in the docs.

All 4 comments

Can you give a code sandbox link with your code reproducing the issue?

Here a codepen example - https://codepen.io/zizther/pen/oNjGeGb?editors=1010

I have included jQuery as it is in my example, but you can replicate the same issue without jQuery.
I have just used the code example from the docs.

You will have to wait for editor to become ready first
https://editorjs.io/configuration#use-isready-promise

Got ya.
You can place it in the onReady callback or listen to the isReady promise.

Would be nice for that to be clearer in the docs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cossssmin picture cossssmin  路  3Comments

talyguryn picture talyguryn  路  3Comments

Yakumo-Yukari picture Yakumo-Yukari  路  5Comments

oknoorap picture oknoorap  路  4Comments

chouglesaud picture chouglesaud  路  3Comments