Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run project error "scope.getTransaction is not a function" #3537

Closed
qq865738120 opened this issue May 12, 2021 · 4 comments
Closed

Run project error "scope.getTransaction is not a function" #3537

qq865738120 opened this issue May 12, 2021 · 4 comments

Comments

@qq865738120
Copy link

Important Details

An error is reported in @sentry/tracing after initialization.Causes the entire page to crash and cannot be opened.
This problem occurs suddenly, and sometimes it returns to normal on its own.

SDK version 6.2.0

Description

When i don't use @sentry/tracing. Will appear hub.startSession is not a function.Here is my initialization code.

{
      Vue,
      dsn: 'https://******@sentry.hydee.cn/3',
      release: `${process.env.VUE_APP_GIT_HASH}`,
      debug: false,
      autoSessionTracking: true,
      environment: process.env.VUE_APP_ENV || 'dev',
      integrations: [new Integrations.BrowserTracing()],
      tracesSampleRate: 0.1,
      trackComponents: true,
      logError: true,
      tracing: false,
      beforeSend: this._beforeSend
 }

The error stack is as follows.

gljs?v=1.exp&key=QVLBZ-YUULR-OUMW7-WKXFD-4SUWS-UCBIH&libraries=visualization,tools,geometry:25 Uncaught TypeError: application 'cloud' died in status LOADING_SOURCE_CODE: hub.startSession is not a function
    at startSessionTracking (sdk.js:188)
    at init (sdk.js:100)
    at init (sdk.js:35)
    at SentryHelper.init (sentry-helper.js:82)
    at Module../src/pages/index/main.js (main.js:15)
    at __webpack_require__ (bootstrap:853)
    at fn (bootstrap:150)
    at Object.1 (index.js:22961)
    at __webpack_require__ (bootstrap:853)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at eval (index.js:11)
    at webpackUniversalModuleDefinition (universalModuleDefinition:9)
    at Proxy.eval (universalModuleDefinition:10)
    at eval (index.js:23036)
    at eval (<anonymous>)
    at geval (index.js?88a9:159)
    at exec (index.js?88a9:175)
    at schedule (index.js?88a9:213)
    at schedule (index.js?88a9:218)
    at schedule (index.js?88a9:218)
    at schedule (index.js?88a9:218)
    at eval (index.js?88a9:224)
    at new Promise (<anonymous>)
    at eval (index.js?88a9:223)
Uncaught TypeError: application 'cloud' died in status LOADING_SOURCE_CODE: scope.getTransaction is not a function
    at clearActiveTransaction (idletransaction.js:257)
    at new IdleTransaction (idletransaction.js:72)
    at startIdleTransaction (hubextensions.js:150)
    at BrowserTracing.push../node_modules/@hydee-sentry/tracing/esm/browser/browsertracing.js.BrowserTracing._createRouteTransaction (browsertracing.js:80)
    at eval (browsertracing.js:53)
    at defaultRoutingInstrumentation (router.js:16)
    at BrowserTracing.push../node_modules/@hydee-sentry/tracing/esm/browser/browsertracing.js.BrowserTracing.setupOnce (browsertracing.js:53)
    at setupIntegration (integration.js:49)
    at eval (integration.js:63)
    at Array.forEach (<anonymous>)
    at setupIntegrations (integration.js:61)
    at BrowserClient.push../node_modules/@hydee-sentry/core/esm/baseclient.js.BaseClient.setupIntegrations (baseclient.js:150)
    at t.bindClient (gljs?v=1.exp&key=QVLBZ-YUULR-OUMW7-WKXFD-4SUWS-UCBIH&libraries=visualization,tools,geometry:53)
    at initAndBind (sdk.js:16)
    at init (sdk.js:98)
    at init (sdk.js:35)
    at SentryHelper.init (sentry-helper.js:82)
    at Module../src/pages/index/main.js (main.js:15)
    at __webpack_require__ (bootstrap:853)
    at fn (bootstrap:150)
    at Object.1 (index.js:22961)
    at __webpack_require__ (bootstrap:853)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at eval (index.js:11)
    at webpackUniversalModuleDefinition (universalModuleDefinition:9)
    at Proxy.eval (universalModuleDefinition:10)
    at eval (index.js:23036)
    at eval (<anonymous>)
    at geval (index.js?88a9:159)
    at exec (index.js?88a9:175)
    at schedule (index.js?88a9:213)
    at schedule (index.js?88a9:218)
    at schedule (index.js?88a9:218)
    at schedule (index.js?88a9:218)
    at eval (index.js?88a9:224)
    at new Promise (<anonymous>)
    at eval (index.js?88a9:223)

Steps to Reproduce

1.Create a Qiankun sub-app.
2.Use sentry in sub-applications.
3.Startup project.
4.Occasionally reported errors.

What you expected to happen

Do not report an error, and the project is running normally.

@BYK BYK transferred this issue from getsentry/sentry May 12, 2021
@kamilogorek
Copy link
Contributor

Can you provide your yarn.lock or package-lock.json file?

@qq865738120
Copy link
Author

qq865738120 commented May 13, 2021

Can you provide your yarn.lock or package-lock.json file?

yarn.lock.zip
I fork the sentry code and sent the package to the company's internal server, so the sentry you see has become @hydee-sentry/*

@kamilogorek
Copy link
Contributor

Please update to at least 6.2.2 where we fixed this issue.

https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#622

[hub] fix: Only create sessions if the correct methods are defined (#3281)

@qq865738120
Copy link
Author

Please update to at least 6.2.2 where we fixed this issue.

https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#622

[hub] fix: Only create sessions if the correct methods are defined (#3281)

It was found that the problem was because we used Tencent maps and conflicts with sentry in the Tencent map api. I tried to remove the Tencent map api file and everything worked fine.So it's because of the gljs file that caused this bug.Thank you very much. I will also upgrade sentry to the latest version to try to resolve the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants