Widget decoration not added to dom (gapcursor)

I’m debugging an issue with using gapcursor in my app. When the parent node of the gapcursor head is a certain node-type from my schema, the widget decoration is not present in the dom. For other node-types it works fine.

Is there anything I could have done that could prevent a widget decoration from being added?

I’ve disabled all plugins except gapCursor, all node-views (don’t think that’s relevant, but just in case).

I’ve confirmed the following with console logging / watch expressions:

  • The selection is a gapcursor
  • The selection head is the correct position
  • the drawGapCursor function from the plugin is called, and is returning the DecorationSet
  • document.querySelector(‘.ProseMirror-gapcursor’) is null

The toDOM of the offending node-type is simpy:

  toDOM: () => ['div', {class: 'items'}, 0],

Following up to say I put together a minimal reproduction and it doesn’t have the problem, so clearly something I did wrong. Will post an update when I figure it out, in case it’s of use to others.

After a long debugging journey, this got fixed by deleting node_modules and reinstalling. Sorry for the noise!