Skip to content

[Bug]: Calling 'createImageBitmap' throws an exception #1421

@daibhin

Description

@daibhin

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.11

Expected Behavior

Canvas recording can be enabled without exception firing

Actual Behavior

An exception is thrown within our SDK

Uncaught (in promise) DOMException: Failed to execute 'createImageBitmap' on 'Window': The source image width is 0.
    at e.<anonymous> (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:74170)
    at l (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:1844)
    at Generator._invoke (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:1597)
    at Generator.next (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:2207)
    at https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:61073
    at new Promise (<anonymous>)
    at Qe (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:60818)
    at https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:73736
    at Array.forEach (<anonymous>)
    at e (https://us-assets.i.posthog.com/static/recorder-v2.js?v=1.110.0:1:73708)

Steps to Reproduce

Exact steps are not clear to me but the exception seems to suggest that it is caused by a canvas with a width of 0 occurring on the page

Testcase Gist URL

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions