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.

Error DOMException: Failed to execute 'setEnd' on 'Range': The offset 45 is larger than the node's length (44).

See original GitHub issue
  • html2canvas version tested with: 1.0.0-alpha.4
  • Browser & version: Google Chrome 63.0.3239.84 64-bit
  • Operating system: Windows 10
Error DOMException: Failed to execute 'setEnd' on 'Range': The offset 45 is larger than the node's length (44).
    at getRangeBounds (http://my-local-site.test/libraries/html2canvas/dist/html2canvas.js?v=1.0.0-alpha.4:2310:11)
    at parseTextBounds (http://my-local-site.test/libraries/html2canvas/dist/html2canvas.js?v=1.0.0-alpha.4:2278:54)
    at Function.fromTextNode (http://my-local-site.test/libraries/html2canvas/dist/html2canvas.js?v=1.0.0-alpha.4:1640:84)
    at parseNodeTree (http://my-local-site.test/libraries/html2canvas/dist/html2canvas.js?v=1.0.0-alpha.4:2887:64)
    at parseNodeTree (http://my-local-site.test/libraries/html2canvas/dist/html2canvas.js?v=1.0.0-alpha.4:2918:29)

Happens when trying to run the h2c function, prevents the canvas from being created.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
elvomkacommented, Feb 1, 2022

The special character ß will be rendered as SS if you have a text-transform: uppercase; and this will trick html2canvas. I solved it by replacing ß by SS in the markup, when I knew the text would be rendered in uppercase.

2reactions
balgopal14commented, Feb 22, 2019

I found the root cause of this error, if any special character like (‘ß’) present in your text and its Unicode html conversion is ‘ss’ that’s increase the length of offset. Please update the library Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error DOMException: Failed to execute 'setEnd' on 'Range'
Error DOMException : Failed to execute 'setEnd' on 'Range': The offset 45 is larger than the node's length (44).
Read more >
Uncaught DOMException: Failed to execute 'setStart' on 'Range'
Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset some integer is larger than the node's length ( some smaller integer ) ......
Read more >
Wheel Offset - Tyre Size Calculator
Wheel offset is what locates the tyre and wheel/rim assembly in relation to the suspension. it's the measured distance between the mounting pad...
Read more >
#12152 (Failed to execute 'setStart' on 'Range': The offset 2 is ...
Uncaught IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 111 is larger than or equal to the node's length (23). ckeditor.js:405 ...
Read more >
rangy-core.js - Paris Cocktail
UNDEFINED; 44 } 45 46 // Creates a convenience function to save verbose repeated ... 220 221 throw new Error("Module '" + this.name...
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