rollbar / rollbar.js

Error tracking and logging from Javascript to Rollbar

Home Page:https://docs.rollbar.com/docs/javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inspector is not available

Nikamura opened this issue · comments

We are building our application using https://github.com/vercel/pkg and after migration from v2.19.4 to v2.20.0 of rollbar.js lib it started to break. We are using Node 12, but happens on Node 14 as well.

pkg package.json --targets node12-macos-x64 --output server-start
Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
    at inspector.js:24:9
    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:277:7)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:219:10)
    at loadNativeModule (internal/modules/cjs/helpers.js:24:9)
    at Function.Module._load (internal/modules/cjs/loader.js:848:15)
    at Module.require (internal/modules/cjs/loader.js:1024:19)
    at Module.require (pkg/prelude/bootstrap.js:1225:31)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/snapshot/canary/node_modules/rollbar/src/server/locals.js:2:17)
    at Module._compile (pkg/prelude/bootstrap.js:1320:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
    at Module.load (internal/modules/cjs/loader.js:984:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1024:19)
    at Module.require (pkg/prelude/bootstrap.js:1225:31)
    at require (internal/modules/cjs/helpers.js:72:18)

which seems to be introduced by #902 this PR.

Downgrading the package to an earlier version doesn't throw the error.

@Nikamura thank you for the report.

The root issue here is that vercel/pkg isn't actually using Node. It builds its own "base binaries" that are a subset of Node.

pkg has so called "base binaries" - they are actually same node executables but with some patches applied. They are used as a base for every executable pkg creates.

This has been reported in vercel/pkg Github Issues a number of times, and in this one, a workaround is suggested. vercel/pkg#93

I'll look into what workaround might be possible in Rollbar.js.

@Nikamura v2.21.0 now loads the locals module separately, and the vercel/pkg builds should work now.

https://github.com/rollbar/rollbar.js/releases/tag/v2.21.0