sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

`isOlderThan` is not a function

Open jd-carroll opened this issue 1 year ago • 2 comments

Cross posting here, as I'm starting to believe the issue is in @sentry/core

Original Ticket: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/533 Probably Related: #12151

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)"
  ]

jd-carroll avatar May 22 '24 04:05 jd-carroll

I'll also note: If I remove the esbuild plugin integration for sourcemaps, there is no issue. However, I have not been able to fully validate a deployed lambda yet. --> So I don't know if there is also an issue at runtime.

This is the last step of a full ESM migration 🎊

jd-carroll avatar May 22 '24 04:05 jd-carroll

We have an idea how to fix issues like this one, where multiple Sentry versions compete for the global.__SENTRY__ object. I'm working on this at the moment and will open a PR once it's in a good state.

Lms24 avatar May 23 '24 10:05 Lms24

I'm still hitting this in version 8.5.0, tried downgrading and I have found working version 7.115.0, so it seems that this was introduced in v8

luckylooke avatar May 28 '24 07:05 luckylooke

This PR: https://github.com/getsentry/sentry-javascript/pull/12206 (or something similar) will hopefully resolve this issue for good!

mydea avatar May 28 '24 08:05 mydea

Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.7.0 - please give it a try!

AbhiPrasad avatar May 29 '24 17:05 AbhiPrasad