Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught RangeError: Adding different instances of a keyed plugin (plugin$) #2631

Closed
xbw19975 opened this issue Jul 28, 2022 · 12 comments
Closed
Labels

Comments

@xbw19975
Copy link

when i use @toast-ui/react-editor in react project , i got this bug:
Uncaught RangeError: Adding different instances of a keyed plugin (plugin$)

@xbw19975 xbw19975 added the Bug label Jul 28, 2022
@xbw19975
Copy link
Author

The mistake happened in "node_modules/@toast-ui/editor/node_modules/prosemirror-state/dist/index.es.js" Line 761

@enlightenL
Copy link

I also had the same thing happen. In codesandbox, downgrading to version 3.1.8 is fine, but when running locally, any version gives an error.

@chenyunc123
Copy link

I also have this problem, running locally is fine, running online will report this error

@qqww08
Copy link

qqww08 commented Jul 29, 2022

next 12.2.2
react 17.0.2
@toast-ui/react-editor 3.1.10
yarn berry
환경에서 똑같은 에러가 발생합니다

패키지 매니저를 npm 으로 바꾸니 정상으로 작동합니다

@xbw19975 xbw19975 reopened this Jul 29, 2022
@enlightenL
Copy link

next 12.2.2 react 17.0.2 @toast-ui/react-editor 3.1.10 yarn berry 환경에서 똑같은 에러가 발생합니다

패키지 매니저를 npm 으로 바꾸니 정상으로 작동합니다

저도 yarn berry 에서 그랬었습니다.
yarn berry의 유령 의존성을 없애주는 특성때문에
관련 dependency가 없어서 그런것일까요?
(prosemirror 관련 모듈들 다 깔아봤는데도 안되긴 합니다...)

@FreekVR
Copy link

FreekVR commented Jul 29, 2022

Having the same issues with the vue-editor since a recent yarn upgrade. Also coming from prosemirror-state.

I had to downgrade both the vue-editor and add a yarn resolution to also force the tui editor itself to 3.1.8 both to resolve the issue.

{
   "dependencies": {
        "@toast-ui/vue-editor": "3.1.8",
    }
    "resolutions": {
        "@toast-ui/editor": "3.1.8",
     }
}

@Dovernh
Copy link

Dovernh commented Jul 29, 2022

using angular 13, i get the error in the developers console and the editor is not rendered. i backed off to the previous version of 3.1.1

core.mjs:6494 ERROR RangeError: Adding different instances of a keyed plugin (plugin$)
at index.es.js:761:9
at Array.forEach ()
at new Configuration (index.es.js:759:18)
at Function.create (index.es.js:897:1)
at EditorBase.createState (index.js:1742:16)
at MdEditor.createView (index.js:4291:1)
at new MdEditor (index.js:4197:1)
at ToastUIEditor.ToastUIEditorCore (index.js:22352:1)
at new ToastUIEditor (index.js:25680:1)
at AppComponent.ngOnInit (app.component.ts:15:20)

Also have typescript errors that i have to shutoff in order to build

Build at: 2022-07-29T20:11:02.797Z - Hash: 82ac0583d09b2ca6 - Time: 9906ms

Error: node_modules/@toast-ui/editor/types/editor.d.ts:307:47 - error TS2707: Generic type 'Plugin' requires between 0 and 1 type arguments.

307 createKeymaps(useCommandShortcut: boolean): Plugin<any, any>[];
~~~~~~~~~~~~~~~~

Error: node_modules/@toast-ui/editor/types/spec.d.ts:4:10 - error TS2459: Module '"prosemirror-commands"' declares 'Command' locally, but it is not exported.

4 import { Command } from 'prosemirror-commands';
~~~~~~~

node_modules/prosemirror-commands/dist/index.d.ts:2:10
2 import { Command } from 'prosemirror-state';
~~~~~~~
'Command' is declared here.

Error: node_modules/@toast-ui/editor/types/spec.d.ts:40:14 - error TS2707: Generic type 'Plugin' requires between 0 and 1 type arguments.

40 keymaps(): Plugin<any, any>[];

@songjihyeok
Copy link

songjihyeok commented Aug 2, 2022

Use npm install --save @toast-ui/editor
Dont use yarn add @toast-ui/editor

@jajugoguma
Copy link
Contributor

jajugoguma commented Aug 3, 2022

I apologize for any inconvenience. The problem you mentioned is being checked, and I'll fix it and publish a new version by 12 Aug at the latest. I would appreciate it if you could use version 3.1.8 in the meantime, even if it is inconvenient.

@Dovernh
Copy link

Dovernh commented Aug 3, 2022

I can now use the latest editor 3.1.10 in angular 13.

  • I removed the setting to skipLibCheck, which was hiding typescript Plugin errors
  • I now use toastui-editor-only.css, this gets rid of the @charset must precede all other statements warning
  • Added types for prosemirror, to get rid of warnings during compile

@bobvandevijver
Copy link

This is also broken with Vue, downgrading to 3.1.8 solves the issue for now.

@xbw19975
Copy link
Author

xbw19975 commented Aug 8, 2022

若带来不便请谅解。您提到的问题正在检查中,我将修复它并最迟在 8 月 12 日前发布新版本。如果您能同时使用 3.1.8 版,我将不胜感激,即使它不方便。
All right, thanks for your efforts

ahamelers pushed a commit to ahamelers/tui.editor that referenced this issue Aug 21, 2023
* env: update prosemirror versions

* chore: fix types according to prosemirror updates

* chore: remove something added to DOM by prosemirror

* test: fix tests following prosemirror updates

* chore: fix type errors

* chore: apply code reviews

test: fix failing tests
chore: implement method that was not
chore: remove unused utility function

* chore: change npm ci to npm install in ci test workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants