-
-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE11 : Exception when resolving position during readDOMChange #547
Comments
I'm not seeing this in my demos. Could you submit a minimal script that sets up an editor which shows the issue? |
Here is the script, built from the example setup in the doc : The build is made with the latest available versions in npm, except prosemirror-view which come from the github master branch. |
Your bundler is somehow creating a bundle that initializes modules multiple times, which results in multiple instances of the You can add a console.log to the toplevel, for example near |
Ok I'm gonna look into this, thanks for the reply. Wouldn't have guessed that this could be a bundling issue. Sorry for the waste of time. |
Commenting on an old issue but we just ran into the same problem and it took too long to find this issue and the double-included bundled module hint above. So for us it manifested as text edits throwing In our case the root issue was badly done package.json dependency version update, that messed up yarn.lock file. Top level project package.json declared it wanted 1.0.1 of pm modules, but some of the modules had older 1.0.0 ones in their own node_modules dirs. Result was this:
And thus at runtime, pm-markdown used one instance of pm-model, pm-view another copy and the Fragment class instanceof checks etc didn't work properly any more. Fix was to |
@erkiesken, thank you for this report! I was debugging this for an hour now. So mysterious. |
Following your recent fixes on prosemirror-view regarding IE11, we grabbed this latest version and made a few tests this morning.
It seems that the fixes on the Node.contains method and keydown handling have uncovered another issue with IE11.
At each keystroke, there's an unhandled exception thrown at prosemirror-model/resolvedpos.js
if (!(pos >= 0 && pos <= doc.content.size)) { throw new RangeError("Position " + pos + " out of range") }
The debugger indicate that
doc.content.size
isNaN
. This happen whatever the keystroke.We weren't able to find out why the document size is incorrectly set.
We tried to comment this check to obtain more informations, but we only end up with another exception because
readDOMChange
send aNaN
post when doingvar $to = parsed.resolveNoCache(change.endB - range.from)
( change.endB is NaN )
Hope that'll help narrow down the source of the issues.
The text was updated successfully, but these errors were encountered: