Skip to content

Replay: canvas error not caught by CanvasManager errorHandler #11001

Closed as not planned

Description

@bruno-garcia

We recently got a patch for Replay canvas that should catch rrweb errors in the canvas manager:

it's on version 8.0.0-alpha.2 as well as backported to 7.104.0

However, a customer on version 7.105.0 using the CDN observed the following error in their Sentry project:

No user code is found on the stack trace:
image

Raw:

"exception": {
"values": [
{
"type": "TypeError",
"value": "Cannot read properties of undefined (reading 'timestamp')",
"stacktrace": {
"frames": [
{
"function": "worker.onmessage",
"module": "@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager",
"filename": "../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js",
"abs_path": "https://browser.sentry-cdn.com/node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js",
"lineno": 111,
"colno": 18,
"pre_context": [
"            const { id } = data;",
"            snapshotInProgressMap.set(id, false);",
"            if (!('base64' in data))",
"                return;",
"            const { base64, type, width, height } = data;"
],
"context_line": "            this.mutationCb({",
"post_context": [
"                id,",
"                type: CanvasContext['2D'],",
"                commands: [",
"                    {",
"                        property: 'clearRect',"
],
"in_app": false,
"data": {
"sourcemap": "https://browser.sentry-cdn.com/7.105.0/replay-canvas.min.js.map",
"resolved_with": "scraping",
"symbolicated": true
}
},
{
"function": "canvasManager.mutationCb",
"module": "replay/build/npm/esm/index",
"filename": "../../../replay/build/npm/esm/index.js",
"abs_path": "https://browser.sentry-cdn.com/replay/build/npm/esm/index.js",
"lineno": 3679,
"colno": 38,
"pre_context": [
"    }",
"    const processedNodeManager = new ProcessedNodeManager();",
"    const canvasManager = _getCanvasManager(getCanvasManager, {",
"        mirror,",
"        win: window,"
],
"context_line": "        mutationCb: (p) => wrappedEmit(wrapEvent({",
"post_context": [
"            type: EventType.IncrementalSnapshot,",
"            data: {",
"                source: IncrementalSource.CanvasMutation,",
"                ...p,",
"            },"
],
"in_app": true,
"data": {
"sourcemap": "https://browser.sentry-cdn.com/7.105.0/bundle.tracing.replay.min.js.map",
"resolved_with": "scraping",
"symbolicated": true
}
},
{
"function": "wrappedEmit",
"module": "replay/build/npm/esm/index",
"filename": "../../../replay/build/npm/esm/index.js",
"abs_path": "https://browser.sentry-cdn.com/replay/build/npm/esm/index.js",
"lineno": 3618,
"colno": 38,
"pre_context": [
"                return;",
"            }",
"            incrementalSnapshotCount++;",
"            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;",
"            const exceedTime = checkoutEveryNms &&"
],
"context_line": "                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;",
"post_context": [
"            if (exceedCount || exceedTime) {",
"                takeFullSnapshot(true);",
"            }",
"        }",
"    };"
],
"in_app": true,
"data": {
"sourcemap": "https://browser.sentry-cdn.com/7.105.0/bundle.tracing.replay.min.js.map",
"resolved_with": "scraping",
"symbolicated": true
}
}
]
},
"raw_stacktrace": {
"frames": [
{
"function": "u.onmessage",
"filename": "[/7.105.0/replay-canvas.min.js](https://us.sentry.io/7.105.0/replay-canvas.min.js)",
"abs_path": "https://browser.sentry-cdn.com/7.105.0/replay-canvas.min.js",
"lineno": 2,
"colno": 9553,
"pre_context": [
"[/*! @sentry-internal/replay-canvas 7.105.0 (e23dc27) | https://github.com/getsentry/sentry-javascript */](https://us.sentry.io/*!%20@sentry-internal/replay-canvas%207.105.0%20(e23dc27)%20%7C%20https://github.com/getsentry/sentry-javascript%20*/)"
],
"context_line": "{snip} n n))return;const{base64:r,type:s,width:i,height:o}=n;this.mutationCb({id:e,type:h[\"2D\"],commands:[{property:\"clearRect\",args:[0,0,i,o]},{pr {snip}",
"post_context": [
"[//# sourceMappingURL=replay-canvas.min.js.map](https://github.com/#%20sourceMappingURL=replay-canvas.min.js.map)"
],
"in_app": true
},
{
"function": "U.mutationCb",
"filename": "[/7.105.0/bundle.tracing.replay.min.js](https://us.sentry.io/7.105.0/bundle.tracing.replay.min.js)",
"abs_path": "https://browser.sentry-cdn.com/7.105.0/bundle.tracing.replay.min.js",
"lineno": 2,
"colno": 133881,
"pre_context": [
"[/*! @sentry/browser & @sentry/tracing & @sentry/replay 7.105.0 (e23dc27) | https://github.com/getsentry/sentry-javascript */](https://us.sentry.io/*!%20@sentry/browser%20&%20@sentry/tracing%20&%20@sentry/replay%207.105.0%20(e23dc27)%20%7C%20https://github.com/getsentry/sentry-javascript%20*/)"
],
"context_line": "{snip} asManager\"),new Eo}}(j,{mirror:$o,win:window,mutationCb:t=>q(Ro({type:qi.IncrementalSnapshot,data:{source:Wi.CanvasMutation,...t}})),recordC {snip}",
"post_context": [
"[//# sourceMappingURL=bundle.tracing.replay.min.js.map](https://github.com/#%20sourceMappingURL=bundle.tracing.replay.min.js.map)"
],
"in_app": true
},
{
"function": "q",
"filename": "[/7.105.0/bundle.tracing.replay.min.js](https://us.sentry.io/7.105.0/bundle.tracing.replay.min.js)",
"abs_path": "https://browser.sentry-cdn.com/7.105.0/bundle.tracing.replay.min.js",
"lineno": 2,
"colno": 133064,
"pre_context": [
"[/*! @sentry/browser & @sentry/tracing & @sentry/replay 7.105.0 (e23dc27) | https://github.com/getsentry/sentry-javascript */](https://us.sentry.io/*!%20@sentry/browser%20&%20@sentry/tracing%20&%20@sentry/replay%207.105.0%20(e23dc27)%20%7C%20https://github.com/getsentry/sentry-javascript%20*/)"
],
"context_line": "{snip} AttachIframe)return;z++;const e=r&&z>=r,s=n&&t.timestamp-U.timestamp>n;(e||s)&&Z(!0)}},W=t=>{q(Ro({type:qi.IncrementalSnapshot,data:{source: {snip}",
"post_context": [
"[//# sourceMappingURL=bundle.tracing.replay.min.js.map](https://github.com/#%20sourceMappingURL=bundle.tracing.replay.min.js.map)"
],
"in_app": true
}
]
},
"mechanism": {
"type": "onerror",
"handled": false
}
}
]
},

Activity

  1. web3max commented on Mar 18, 2024

    @web3max

    I'm having the same problem, this error keeps getting reported to sentry.
    did-pte-ltd sentry io_issues_5078561062__environment=prod environment=production project=4506324212645888 project=4505870957412352 project=4506119936147456 project=4504791611146240 project=4506218423582720 project=4506540978405376 project=4

  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Mar 18, 2024
  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Mar 19, 2024
  4. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Apr 15, 2024
  5. ishields commented on Apr 15, 2024

    @ishields

    Same happened to me. I was on 7.108.0 and was getting the problem. I upgraded the package to the latest version and the issue was fixed. It took me a while to track this problem down to this repository so unfortunately this error caused us to hit our error budget early this month.

  6. Lms24 commented on Apr 16, 2024

    @Lms24
    Member

    Hey @ishields apologies for that! Let me check with our support team if we can do something about the quota! Can you share a link to the Sentry issue/event?

    This issue should have been fixed with 7.109.0 (#11317). If anyone is still experiencing this issue, please let us know, thanks!

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Apr 16, 2024
  8. moved this to Waiting for: Community in GitHub Issues with 👀 2on Apr 16, 2024
  9. Lms24 commented on Apr 16, 2024

    @Lms24
    Member

    Hey @ishields I talked to support. To get your quota depletion resolved please open a support ticket here. Our support team will take if from there. Sorry again for the inconvenience!

  10. ishields commented on Apr 16, 2024

    @ishields

    @Lms24 Really appreciate that. I reached out to support and they were able to fix this for me. Thanks for all the hard work!

  11. moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 2on Apr 16, 2024
  12. mydea commented on Apr 16, 2024

    @mydea
    Member

    Great to hear! So if I understand correctly, this is fixed on latest versions and we can close this issue?

  13. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Apr 16, 2024
  14. moved this to Waiting for: Community in GitHub Issues with 👀 2on Apr 19, 2024
  15. getsantry commented on May 11, 2024

    @getsantry

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions