Skip to content
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

isOlderThan is not a function #533

Closed as not planned
Closed as not planned

Description

@jd-carroll

Environment

    "@sentry/esbuild-plugin": "^2.16.1",

Actual Result

Still investigating, but my builds are all failing with:

  "message": "getHubFromCarrier(...).isOlderThan is not a function",
  "stack": [
    "TypeError: getHubFromCarrier(...).isOlderThan is not a function",
    "    at getGlobalHub (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:6631:33)",
    "    at getCurrentHub (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:6612:10)",
    "    at getClient (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:4967:10)",
    "    at hasTracingEnabled (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:6843:18)",
    "    at sampleTransaction (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:7938:8)",
    "    at Hub._startTransaction (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:8095:17)",
    "    at Hub._callExtensionMethod (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:6555:40)",
    "    at Hub.startTransaction (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:6423:25)",
    "    at _callee$ (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:14342:25)",
    "    at tryCatch (file:///home/runner/work/monorepo/monorepo/node_modules/@sentry/bundler-plugin-core/dist/esm/index.mjs:90:17)"
  ]

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 22, 2024
  2. jd-carroll commented on May 22, 2024

    @jd-carroll
    Author

    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?

  3. jd-carroll commented on May 22, 2024

    @jd-carroll
    Author

    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

  4. lforst commented on May 22, 2024

    @lforst

    Can you try setting telemetry: false? Thanks!

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 22, 2024
  6. Lms24 commented on May 22, 2024

    @Lms24
    Member

    Hey @jd-carroll - this is most likely fixed by getsentry/sentry-javascript#12160 which we're gonna release today.

  7. jd-carroll commented on May 22, 2024

    @jd-carroll
    Author

    @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?

  8. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 22, 2024
  9. jd-carroll commented on May 22, 2024

    @jd-carroll
    Author

    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... 😄

  10. jd-carroll commented on May 22, 2024

    @jd-carroll
    Author

    @Lms24 It does not appear this was fixed in @sentry/[email protected] (fyi)

  11. Lms24 commented on May 22, 2024

    @Lms24
    Member

    Yup, sorry about that, we had to close the PR in favor of a better fix

  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 22, 2024
  13. moved this to Waiting for: Community in GitHub Issues with 👀 3on Jun 10, 2024
  14. getsantry commented on Jul 2, 2024

    @getsantry

    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 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions