question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

core.js: An exception occurred while resetting the "Range" object.

See original GitHub issue

Hi @JiHong88 ,

I’m using the following function to clear the editor body text. The function use’s commandHandler to selectAll content and remove the node. But after calling this function I’m getting a warning emitted from core.js lib about resetting RANGE object.

Is it possible to expose a public property on SunEditor to clear the body text? Or would you suggest a different approach to my function below?

 @Input() set clearText(clearText: boolean) {
    if (clearText && this.editorInstance) {
      this.editorInstance.core.commandHandler(null, 'selectAll');
      this.editorInstance.core.removeNode();
    }
  }

Console Error: core.js?4e0d:1630 [SUNEDITOR.core.removeNode.exception] An exception occurred while resetting the “Range” object.

Complete Stack Trace:

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JiHong88commented, Oct 23, 2020

Thanks for reporting.

Resets the “Range” object when deleting, inserting, or modifying a node. This warning is displayed when the cannot be set appropriate text node to the “container” when run removeNode method. But in most cases, the code runs fine.

I put a warning because it occurs in certain situations. Can you show the HTML of the editor when outputting the warning?

0reactions
ColmShannoncommented, Nov 16, 2020

Hi @JiHong88, thank you. That seems to have resolved our issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The specified value cannot be parsed, or is out of range when ...
When the value is transformed in the number pipe, it is first parse to Number . If it is not parse-able, then you...
Read more >
Errors | Node.js v19.3.0 Documentation
When an asynchronous method is called on an object that is an EventEmitter , errors can be routed to that object's 'error' event....
Read more >
Built-in Exceptions — Python 3.11.1 documentation
This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full”...
Read more >
Microsoft Graph error responses and resource types
Learn about errors that can be returned in Microsoft Graph responses. Errors are returned using standard HTTP status codes and a JSON error...
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The JavaScript RangeError: Maximum call stack size exceeded is an error that occurs when there are too many function calls, or if a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found