jest-prosemirror: RangeError: Adding different instances of a keyed plugin (plugin$)
caused by adding an inputRules plugin
#2216
Labels
type: bug 🪲
Something isn't working
Summary
Hi, I am getting the error
RangeError: Adding different instances of a keyed plugin (plugin$)
when trying to usejest-prosemirror
. I am aware of #1811 and I think this is a different issue.Steps to reproduce
Expected results
No error
Actual results
RangeError: Adding different instances of a keyed plugin (plugin$)
Possible Solution
The bug is caused because there are 2 plugins with the same key
plugin$
. One is the one passed by me, the second one is constructed here:remirror/packages/jest-prosemirror/src/jest-prosemirror-editor.ts
Line 115 in dd4d6ff
Because
inputRules()
always produces the same key for the plugin, the 2 instances clash with each other.I think the proper solution would be to remove the
rules
option fromcreateEditor()
altoghether and let the user createinputRules()
themselves. In my case, I am actually getting the input rules plugin from another package, so I can't just pass the rules tojest-prosemirror
directly easily...The text was updated successfully, but these errors were encountered: