Cannot read properties of undefined (reading 'add')

Hello guys

Intermittently I’m getting this issue report, any help or idea to prevent it would be helpul

TypeError: Cannot read properties of undefined (reading 'add')
  at NodeViewDesc.prototype.selectNode(./node_modules/prosemirror-view/dist/
  at syncNodeSelection(./node_modules/prosemirror-view/dist/
  at selectionToDOM(./node_modules/prosemirror-view/dist/
  at EditorView.prototype.focus(./node_modules/prosemirror-view/dist/
  at updateSelection(./node_modules/prosemirror-view/dist/
  at selectClickedLeaf(./node_modules/prosemirror-view/dist/
  at handleSingleClick(./node_modules/prosemirror-view/dist/
  at MouseDown.prototype.up(./node_modules/prosemirror-view/dist/
  at sentryWrapped(./node_modules/@sentry/browser/esm/helpers.js:90:17)

That’s going to be from this code…

  if (this.nodeDOM.nodeType == 1)

Do you have any information on what browser the user that gets the error is using? Nodes with nodeType == 1 (elements) should have a classList property on all browsers ProseMirror supports.

Hey - this is the data I have regarding that issue image

Hey, man!, just wondering if you have any ideas on how can I avoid this.

No, I’m stumped—it seems logically impossible for a standard-conforming browser to not have a classList on an element object, and the line before the one that crashed checks that the node is indeed an element. So without a way to reproduce this, I’m not sure how to figure this out.