You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Any time I run into an error like "Cannot resolve DOM point/node" pertaining to Slate logic, my app just crashes. Is it not possible to catch these errors (internally) somehow? To fail gracefully?
As a workaround I'm wrapping vulnerable selection logic in try/catch blocks ... but it doesn't feel enough. When the editor itself crashes, only thing that catches this is my ErrorBoundary. But again, I don't want a crash in the first place. I'd like to know how others handle this for production apps.
Expectation
A quiet failure, possibly returning null values, warning, or something else.
Environment
Slate Version: all
Operating System: all
Browser: all
TypeScript Version: all
The text was updated successfully, but these errors were encountered:
I store the most recent selection in state. I try to get the DOM point. Luckily toDOMPoint() throws catchable errors. If the domPoint exists, I perform the selection.
I think the Docs should be clear that methods of Transforms do not throw errors and are thus uncatchable. And that errors in functions like ReactEditor.toDomPoint can be caught instead.
Description
Any time I run into an error like "Cannot resolve DOM point/node" pertaining to Slate logic, my app just crashes. Is it not possible to catch these errors (internally) somehow? To fail gracefully?
As a workaround I'm wrapping vulnerable selection logic in try/catch blocks ... but it doesn't feel enough. When the editor itself crashes, only thing that catches this is my ErrorBoundary. But again, I don't want a crash in the first place. I'd like to know how others handle this for production apps.
Expectation
A quiet failure, possibly returning null values, warning, or something else.
Environment
Slate Version: all
Operating System: all
Browser: all
TypeScript Version: all
The text was updated successfully, but these errors were encountered: