-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Pasted text into markdown field and hit cntrl+z to undo and got an error page #1432
Comments
One of my colleagues experienced this as well (Chrome on WIndows), but I haven't been able to reproduce it myself on Browserstack. He's doing a lot of pasting from Google slides into netlify-cms, so it's quite likely to be the same problem. |
@peterlazzarino Is this happening for every text block, or only certain ones? If so, can you provide an example? |
It happened to me now while debugging something else on Chrome 67/Windows in Browserstack. Steps to reproduce:
This error screen is displayed:
The following error is logged twice in the console:
(Yeah, I know I'm using my fork, but I doubt that has anything to do with it :) |
It's reproducible with the same steps on Chrome 67/OSX. Seems like the important thing is pasting into an empty markdown widget, then hitting CTRL+z. |
Comfirmed, this is affecting top-level markdown widgets as well. @erquhart? |
I did a quick look into this and if it can be to any help, this seems to be triggered after the startKey and endKey of the operation in slate.js both have the value null, which they are when copy paste -> ctrl +z without interacting with the field by input before that action. This then triggers this line since null == null And from there runs the getFurthestAncestor which then runs the assertKey: where the error triggers. I guess the first thing to look at is why the startKey and endKey is null on that exact operation, and not when for example doing the exact same thing, but after the field has already been interacted with before (by putting something in it). I will probably look at this a bit more since i find these kinds of problems interesting (reminds me a lot of problems we've had with draftJS) when I have time. Hope this can be to any help! |
@robertkarlsson really awesome that you're digging into this! I'm wondering if this would be solved by updating Slate, I know we're behind a bit. |
@erquhart You seem to be correct about this according to this issue: ianstormtaylor/slate#1448 The fix was done in: ianstormtaylor/slate@b2e0612 When upgrading to [email protected] (latest) i can not reproduce this error anymore. It's past midnight here in the north so i wont be making a PR right now, but it should solve the issue if someone wants to do one. The other slate related dependencies as slate react may also benefit from an upgrade. |
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change node.kind -> node.object according to deprecation warning introduced in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object (cherry picked from commit 756bf4b)
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
Fixes decaporg#1432 Update Slate and Slate plugin dependencies to be up to date with current versions. Change setBlock -> setBLocks according to deprecation warning in slate 0.33.0 Change node.kind -> node.object according to deprecation warning in Slate 0.32.0 Update Jest snapshot to pass the change from node.kind -> node.object
I added a markdown type field to my page and after pasting a text block into it from my clipboard them command Z on my computer. I am sent to an error page, I can reliably reproduce this
Netlify CMS version: 1.7.0
Browser version: Chrome 67.0.3396.79
Node.JS version: 8.11.2
Operating System: Mac OSX 10.13.3
Config.yml - this is happening in the /about/our-team page in the leadership -> story field
The text was updated successfully, but these errors were encountered: