use-screenshot
use-screenshot copied to clipboard
TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at px (index.es.js?2c84:170:1)
at Object.getNodeWidth (index.es.js?2c84:174:1)
at getImageSize (index.es.js?2c84:800:1)
at toSvgDataURL (index.es.js?2c84:806:1)
at toCanvas (index.es.js?2c84:816:1)
at toPng (index.es.js?2c84:847:1)
at eval (index.es.js?2c84:897:1)
at step (index.es.js?2c84:50:1)
at Object.eval [as next] (index.es.js?2c84:31:46)
at eval (index.es.js?2c84:24:1)
at new Promise (
As shown in the code of the example, you should have an element with id="root" in order to work.
Thank you so much @carlosferragut . Your comment was really helpful in debugging an issue. 🎉