mkhstar / suneditor-react

A React Component for SunEditor (WYSIWYG editor)
http://suneditor.com/
423 stars 105 forks source link

Uncaught Error: [SUNEDITOR.core.callPlugin.fail] #254

Closed krAlena closed 1 year ago

krAlena commented 2 years ago

Hi! Toolbar's actions used in dropdowns have stopped working

<SunEditor
                  placeholder="Placeholder doesn't work"
                  setOptions={{
                        codeMirror: CodeMirror,
                        fontSize: [ 8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72],
                        formats: ['h3', 'h4', 'h5', 'h6', 'p', 'div', 'blockquote', 'pre'],
                        katex: katex,
                        plugins: currentPlugins
                  }}
/>

Versions' info:

    "suneditor": "^2.41.3",
    "suneditor-react": "^3.3.1" 

image

related issue

BahaMagi commented 2 years ago

Any estimate when/if this is going to be fixed?

DeepikaSharma5 commented 2 years ago

@mkhstar @JiHong88 Can you please give use any update on this issue? It's been a while. Really needed those options.

mkhstar commented 2 years ago

A new version has just been released which supports the latest suneditor. Can you check it out?

DeepikaSharma5 commented 2 years ago

@mkhstar it is not fixed. I used 3.4.0 and still getting the same error Also I tried a previous version (2.14.3) where most of the plugins are working, but 'image' is not working. Please check this and fix as soon as possible. My client application is crashing because of this. Screenshot 2022-02-23 211455

JiHong88 commented 2 years ago

@DeepikaSharma5 @krAlena @kidar2 https://github.com/mkhstar/suneditor-react/issues/254#issue-1069934585 This error occurs when using a plugin that is not registered when creating the editor. Does an error occur even if I register the plugin in the options?

DeepikaSharma5 commented 2 years ago

@DeepikaSharma5 @krAlena @kidar2 #254 (comment) This error occurs when using a plugin that is not registered when creating the editor. Does an error occur even if I register the plugin in the options?

Yes it occurring even after register the plugin in options

JiHong88 commented 2 years ago

@DeepikaSharma5 Um.. Does the "suneditor" package get the same error?

DeepikaSharma5 commented 2 years ago

@DeepikaSharma5 Um.. Does the "suneditor" package get the same error?

@JiHong88 I have not checked with that because not using it. Better if you try to create a react project and check this issue. It will be helpful for everyone.

mkhstar commented 2 years ago

@DeepikaSharma5 it will be really helpful if you provide a demo on sandbox for this. Because I can't really reproduce this error

JiHong88 commented 2 years ago

@DeepikaSharma5 This error is not reproduced. Please provide more information so we can reproduce this problem.

krAlena commented 2 years ago

@DeepikaSharma5 @krAlena @kidar2 #254 (comment) This error occurs when using a plugin that is not registered when creating the editor. Does an error occur even if I register the plugin in the options?

JiHong88 Hi! This error occurs when I register the custom plugin in the options. This issue came back with version:

    "suneditor-react": "3.4.1",

but it works fine with

    "suneditor-react": "3.2.0"

image

Example of using:

              <SunEditor
                    getSunEditorInstance={this.getSunEditorInstance}
                    onChange={this.tryContentChange}
                    toggleCodeView={this.toggleCodeView}
                    onImageUploadBefore={this.onImageUploadBefore}
                    imageUploadHandler={this.imageUploadHandler}
                    defaultValue={this.props.htmlContent}
                    setOptions={{
                        codeMirror: CodeMirror,
                        fontSize: [ 8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72],
                        formats: ['h3', 'h4', 'h5', 'h6', 'p', 'div', 'blockquote', 'pre'],
                        katex: katex,
                        plugins: currentPlugins,
                        buttonList: listBtns
                    }}
                />
JiHong88 commented 2 years ago

@krAlena Custom options and default options are all treated the same. Both the basic option and the custom option must be registered. plugins: {custom_plugin, ...plugins}

onyxcool commented 1 year ago

Hi @JiHong88 ,

thank you for the editor - it's really nice and very customizable. I've similar problem described here, can you, please provide more details regarding your last answer?

It's a bit unclear what should I do? I've bunch of plugins which do not work in latest 3.4.1 version.

onyxcool commented 1 year ago

Hi again @JiHong88 ,

I've realized what you mean and now it works as expected. So I had to import plugins and initialize it correctly.

Please, find an image below image