Richeditor error

Rendering a <textarea> in the backend and then calling $(...).richEditor() gives the following error:
TypeError: null is not an object (evaluating ‘this.options.editorOptions.constructor’)

Context: I want to render a custom modal window in my plugin that gets placed before the </body> tag when clicking a specific element in the richeditor field. The textarea inside the modal needs to become a richeditor too, same as the all the others.

I guess try $(...).richEditor({})

Well it solves the error but it’s causing another one

TypeError: null is not an object (evaluating 'this.options.editorOptions.constructor')

Meanwhile I found a workaround by setting it like this:

$(textarea).froalaEditor($.FroalaEditor.DEFAULTS);

I’m not sure if all features are working, I only tasted the basic features so far.