Skip to content

captureConsoleIntegration doesn't work on deno #12400

@brc-dd

Description

@brc-dd

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/deno

SDK Version

8.7.0

Framework Version

1.44.1

Link to Sentry event

No response

SDK Setup

// foo.ts

import * as Sentry from 'npm:@sentry/deno'

Sentry.init({
  dsn: '...',
  integrations: [Sentry.captureConsoleIntegration()],
})

setTimeout(() => {
  console.error(new Error('This is an error'))
  prompt('Press Enter to exit...')
}, 100)

Steps to Reproduce

  1. run deno run -A foo.ts

Expected Result

It sends the error to Sentry.

Actual Result

Nothing happens.

If I manually do something like this it works, but the integration isn't working:

const orig = console.error
console.error = (...args: unknown[]) => {
  if (args.length === 1 && args[0] instanceof Error) {
    Sentry.captureException(args[0])
  }
  orig(...args)
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions