Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANR error if Node is run with --inspect #10024

Closed
3 tasks done
joshkel opened this issue Jan 2, 2024 · 0 comments · Fixed by #10025
Closed
3 tasks done

ANR error if Node is run with --inspect #10024

joshkel opened this issue Jan 2, 2024 · 0 comments · Fixed by #10025
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@joshkel
Copy link
Contributor

joshkel commented Jan 2, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.91.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

import * as Sentry from '@sentry/node';

function configureSentry(
) {
  Sentry.init({
    dsn: process.env.SENTRY_DSN,
    integrations: [new Sentry.Integrations.Anr({captureStackTrace: true})],
  });
}

Steps to Reproduce

import * as Sentry from '@sentry/node';

function configureSentry(
) {
  Sentry.init({
    dsn: process.env.SENTRY_DSN,
    integrations: [new Sentry.Integrations.Anr({captureStackTrace: true})],
  });
}

async function main() {
  configureSentry();
  await new Promise(resolve => setTimeout(resolve, 1000));
  process.exit(0);
}

main();
node --inspect test.mjs

Expected Result

Successful run.

Actual Result

The following error is thrown:

Debugger listening on ws://127.0.0.1:9229/ab2cd6ad-150d-4643-ad5c-8345dd412d13
For help, see: https://nodejs.org/en/docs/inspector
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error [ERR_INSPECTOR_ALREADY_ACTIVATED]: Inspector is already activated. Close it with inspector.close() before activating it again.
    at new NodeError (node:internal/errors:405:5)
    at Object.inspectorOpen [as open] (node:inspector:172:11)
    at Anr._startWorker (/Users/josh/tmp/node_modules/@sentry/node/cjs/integrations/anr/index.js:105:17)
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 2, 2024
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant