Closed yuri2peter closed 1 month ago
Could it be you are loading multiple copies of prosemirror-view, and that is the root of this issue? You don't want that situation anyway (it wastes a lot of bandwidth and script compilation), so the solution here is to fix your dependency tree or bundler.
Could it be you are loading multiple copies of prosemirror-view, and that is the root of this issue? You don't want that situation anyway (it wastes a lot of bandwidth and script compilation), so the solution here is to fix your dependency tree or bundler.
@marijnh "It shouldn't generate additional copies; I've locked its version in package.json."
Well, the fact that we use the instanceof
is intentional, and not something I consider a bug. If your DecorationSet
instances are failing that check, you are somehow loading multiple instances of the library, and it's up to you to figure out why.
The file
prosemirror-view@1.33.6/dist/index.cjs
usesinstanceof DecorationSet
to determine whether an object is of typeDecorationGroup
, which generally works well in most cases.However, I encountered a situation in practical use where this
instanceof DecorationSet
check likely fails, ultimately leading to an error when using the emoji plugin intiptap
.After debugging step by step, I confirmed that the exception occurs here:
I suspect this is due to subtle differences in
constructor
:To ensure smooth operation of my project, I temporarily resolved this issue using the following code, which works well.
I apologize for not providing a complete reproducible demo (I'm not yet proficient with the related tools.) I hope this can assist developers facing similar issues.