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/index.es.js:1441:28)
  at syncNodeSelection(./node_modules/prosemirror-view/dist/index.es.js:2276:24)
  at selectionToDOM(./node_modules/prosemirror-view/dist/index.es.js:2158:3)
  at EditorView.prototype.focus(./node_modules/prosemirror-view/dist/index.es.js:5121:3)
  at updateSelection(./node_modules/prosemirror-view/dist/index.es.js:3602:29)
  at selectClickedLeaf(./node_modules/prosemirror-view/dist/index.es.js:3612:5)
  at handleSingleClick(./node_modules/prosemirror-view/dist/index.es.js:3647:53)
  at MouseDown.prototype.up(./node_modules/prosemirror-view/dist/index.es.js:3794:14)
  at sentryWrapped(./node_modules/@sentry/browser/esm/helpers.js:90:17)

That’s going to be from this code…

  if (this.nodeDOM.nodeType == 1)
    this.nodeDOM.classList.add("ProseMirror-selectednode")

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.