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

Regression: Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available when using vercel/pkg #12223

Closed
3 tasks done
munelear opened this issue May 26, 2024 · 6 comments · Fixed by #12231
Closed
3 tasks done
Assignees
Labels
Package: node Issues related to the Sentry Node SDK Stale Type: Bug

Comments

@munelear
Copy link

munelear commented May 26, 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

8.4.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Build app with Sentry SDK 8.4.0 using pkg
  2. Run app and experience crash

I verified that using sentry 7.31.0 does not have this issue, as noted in issue #6769, this was previously fixed and at some point regressed.

Expected Result

App should not crash

Actual Result

Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
    at new NodeError (node:internal/errors:388:5)
    at node:inspector:23:9
    at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:329:7)
    at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:269:10)
    at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
    at Module._load (node:internal/modules/cjs/loader:792:20)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at Module.require (pkg/prelude/bootstrap.js:1851:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at 86592 (/snapshot/dist/main.js) {
  code: 'ERR_INSPECTOR_NOT_AVAILABLE'
}
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label May 26, 2024
@munelear
Copy link
Author

The regression appears to have happened in the 8.0.0 release timeframe. I am unable to reproduce this issue on 7.116.0.

@mydea

This comment was marked as outdated.

@timfish timfish self-assigned this May 27, 2024
AbhiPrasad pushed a commit that referenced this issue May 27, 2024
Closes #12223

I've added a test that uses `import-in-the-middle` to throw if
`inspector` is imported without enabling the `LocalVariables`
integration so this should not regress in the future.

Note that we don't need to import asynchronously in the worker scripts
since these are not evaluated if the features aren't used.
@AbhiPrasad
Copy link
Member

Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.5.0

@munelear
Copy link
Author

FYI- I tried pulling in release 8.5.0 but I was still experiencing this issue. I'll re-review the release documentation and check if there's something wrong on my end, but I wanted to give you a heads up that this may not be completely resolved yet.

@mydea mydea reopened this May 28, 2024
@timfish
Copy link
Collaborator

timfish commented May 28, 2024

I can't reproduce any build or runtime errors with any v8 SDK version:

package.json

{
  "scripts": {
    "build": "pkg -t node18 index.js"
  },
  "dependencies": {
    "@sentry/node": "^8.5.0",
    "pkg": "^5.8.1"
  }
}

index.js

const Sentry = require('@sentry/node');

Sentry.init({
    dsn: '__DSN__',
    debug: true
});

setInterval(() => {
    console.log('Ping');
}, 1000);

Running:

> yarn && yarn build
> ./index
Sentry Logger [log]: Initializing Sentry: process: 92870, thread: main.
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: NodeFetch
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: LocalVariables
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Running in CommonJS mode.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for diag v1.8.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for trace v1.8.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for context v1.8.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for propagation v1.8.0.
Sentry Logger [log]: Could not load NodeFetch instrumentation.
Ping
Ping
Ping
Ping
Ping
Ping
Ping
Ping

@getsantry
Copy link

getsantry bot commented Jul 5, 2024

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 🥀

@getsantry getsantry bot added the Stale label Jul 5, 2024
@getsantry getsantry bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 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 Stale Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants