Package + Version
Version:
Description
Overriding Sentry.init results in TypeError: Cannot set property init of #<Object> which has only a getter.
With the typescript upgrade to v3.9.7 in v5.21.1, the init export has changed unexpectedly.
It changed from -
var sdk_1 = require("./sdk"); exports.init = sdk_1.init;
to -
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return sdk_1.init; } });
Previously, one could use the following to override Sentry.init which does not work anymore -
`const Sentry = require('@sentry/node');
Sentry.init = (options) => {
init({
dsn: ...
...options
});
Sentry.init()
`