Closed jd-carroll closed 4 months ago
I've been trying to wrap my head around this and cannot seem to be able to.
If I debug locally (I get the same error) and inspecting the registry
object it looks like:
__SENTRY__: {
extensions: {
startTransaction: [Function: _startTransaction],
traceHeaders: [Function: traceHeaders]
},
defaultCurrentScope: ScopeClass {
_notifyingListeners: false,
_scopeListeners: [],
_eventProcessors: [],
_breadcrumbs: [],
_attachments: [],
_user: {},
_tags: {},
_extra: {},
_contexts: {},
_sdkProcessingMetadata: {},
_propagationContext: [Object]
},
defaultIsolationScope: ScopeClass {
_notifyingListeners: false,
_scopeListeners: [],
_eventProcessors: [],
_breadcrumbs: [],
_attachments: [],
_user: {},
_tags: {},
_extra: {},
_contexts: {},
_sdkProcessingMetadata: {},
_propagationContext: [Object]
},
hub: AsyncContextStack {
_stack: [Array],
_isolationScope: [ScopeClass]
}
},
I'm not sure where AsyncContextStack
would be coming from, but that definitely looks wrong.
Let's go ahead and assume this is something I am doing wrong. Where would I even start?
Just for tracking purposes, the AsyncContextStack
is a Sentry construct. I'm no longer assuming that this is an issue with my code.
Additionally, the AsyncContextStack
is created here:
https://github.com/getsentry/sentry-javascript/blob/4420844943418a1bc23a6ccad70401d68a8c94a4/packages/core/src/asyncContext/stackStrategy.ts#L133-L148
Can you try setting telemetry: false
? Thanks!
Hey @jd-carroll - this is most likely fixed by https://github.com/getsentry/sentry-javascript/pull/12160 which we're gonna release today.
@lms24 awesome, thank you, I'll look for that in a bit!
@lforst I tried setting that but it still seems to be throwing the same error (but maybe less...?)
Additionally, I just noticed this in the error output:
{
"id": "import-is-undefined",
"location": {
"column": 44,
"file": "lambdas/user-account-setup-handler/user-account-setup-handler.ts?sentryProxyModule=true",
"length": 7,
"line": 4,
"lineText": " export default OriginalModule.default;",
"namespace": "",
"suggestion": ""
},
"notes": [],
"pluginName": "",
"text": "Import \"default\" will always be undefined because there is no matching export in \"lambdas/user-account-setup-handler/user-account-setup-handler.ts\""
}
I didn't think the Sentry bundler is actually changing the entry point for the lambda. If so, this is hugely concerning because none of my lambdas use "default" as the named entry point for AWS.
Can either of you help me understand what is happening there?
As a side note, I just patched my local code and everything seems to be working. I also inspected the output and confirmed that my named exports still exist. The output contains the following:
// lambdas/user-account-details-handler/user-account-details-handler.ts?sentryProxyModule=true
var user_account_details_handler_default = void 0;
export {
user_account_details_handler_default as default,
handler
};
//# sourceMappingURL=lambda.mjs.map
Nothing is ever assigned to user_account_details_handler_default
other than void 0
. So my assumption would be it is something you look for in the uploaded sourcemaps to Sentry? Either way, no big deal, more so curious now... 😄
@Lms24 It does not appear this was fixed in @sentry/core@8.3.0 (fyi)
Yup, sorry about that, we had to close the PR in favor of a better fix
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 🥀
Environment
Actual Result
Still investigating, but my builds are all failing with: