[Bug]: Unexpected behaviour of configured extensions #4981
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Which packages did you experience the bug in?
core
What Tiptap version are you using?
2.2.4
What’s the bug you are facing?
It applies to all methods in the extension config, but I'll give an example I stumbled upon with
addProseMirrorPlugins
Crashes with
RangeError: Adding different instances of a keyed plugin (someKey$)
.It happens because .configure() extends, so we end up with the hierarchy
ExampleBase -> Example -> Example
instead ofExampleBase -> Example
which results in duplicate plugins being registered.The same problem occurs with other methods, but those that return lists are most vulnerable (e.g.
addInputRule
).I guess
.configure()
should copy the extension instead of extending it.What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
No duplicate plugins are registered.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: