sentry-javascript: Problem with attachments API (getAttachments)
After upgrading sentry to v7 getting below error. I am using sentry with node express project
message: 'finalScope.getAttachments is not a function or its return value is not iterable',
code: undefined,
sentry: '888a4d2d434b4e1c9b5dcea80eb99791',
stack: 'TypeError: finalScope.getAttachments is not a function or its return value is not iterable\n' +
' at NodeClient._prepareEvent (/srv/server/node_modules/@sentry/core/cjs/baseclient.js:403:69)\n' +
' at NodeClient._prepareEvent (/srv/server/node_modules/@sentry/node/cjs/client.js:151:18)\n' +
' at NodeClient._processEvent (/srv/server/node_modules/@sentry/core/cjs/baseclient.js:598:17)\n' +
' at NodeClient._captureEvent (/srv/server/node_modules/@sentry/core/cjs/baseclient.js:554:17)\n' +
' at NodeClient.captureEvent (/srv/server/node_modules/@sentry/core/cjs/baseclient.js:147:12)\n' +
' at NodeClient.captureEvent (/srv/server/node_modules/@sentry/node/cjs/client.js:93:18)\n' +
' at Hub._invokeClient (/srv/server/node_modules/winston-sentry-log/node_modules/@sentry/hub/dist/hub.js:384:35)\n' +
' at Hub.captureEvent (/srv/server/node_modules/winston-sentry-log/node_modules/@sentry/hub/dist/hub.js:171:14)\n' +
' at Transaction.finish (/srv/server/node_modules/@sentry/tracing/cjs/transaction.js:142:22)\n' +
' at Immediate.<anonymous> (/srv/server/node_modules/@sentry/node/cjs/handlers.js:51:21)\n' +
' at processImmediate (internal/timers.js:464:21)\n' +
' at process.topLevelDomainCallback (domain.js:152:15)\n' +
' at process.callbackTrampoline (internal/async_hooks.js:128:24)'
_Originally posted by @pnutmath in https://github.com/getsentry/sentry-javascript/issues/5004#issuecomment-1149504330_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (7 by maintainers)
I’ll take a look into this 😆
One more point here is I am using
winston-sentry-logpackage also to capture error level logs in sentry.And setup I followed is exactly same as mentioned in guide: https://docs.sentry.io/platforms/node/guides/express/ along with sentry tracer.
I have downgraded sentry packages and it working fine as earlier.
We unfortunately do not support any use case where you are running different versions of a Sentry SDK instance in the same environment. You’ll have to make everything is updated to v7!
Once that is done, check out our docs for using individual Sentry clients. This may help point you in the right direction for how to instantiate multiple Sentry clients.