DOMException in Chrome

I have prosemirror setup with collaboration but have encountered an exception raised in Chrome that doesn’t occur in Firefox:

setSelection (prosemirror-view/src/viewdesc.js:366):
   Uncaught (in promise) DOMException: Failed to execute 'extend' on 'Selection': This Selection object doesn't have any Ranges.

It’s triggered when I have two collaborators editing the same document and one of them deletes all of the text in the document. If the other browser is Chrome the exception is raised. If the other browser is Firefox the exception is not.

I found a similar bug in draft-js:

Which they tracked to this change in Chrome:

It looks like the spec requires an exception when calling .extend() with an empty range. I assume Firefox doesn’t implement the spec correctly.

ProseMirror doesn’t (intentionally) call extend on a possibly-empty selection. The only place where it calls that is directly after calling addRange (or, since 1.14.4, collapse), which should ensure that there’s a range in the selection.

Can you set up a situation that simulates this case in a deterministic way (using a programmatic change instead of collaborative editing)?