GithubHelp home page GithubHelp logo

Comments (8)

StPaulis avatar StPaulis commented on July 30, 2024 4

Any news about that? I can confirm that the problem exists in 7.36.0 also.

from nestjs-sentry.

AdamGerthel avatar AdamGerthel commented on July 30, 2024 1

Has anyone managed to solve this issue?

from nestjs-sentry.

svachmic avatar svachmic commented on July 30, 2024

This seems to be a problem with all integrations. I get type error since @nestjs version 9.2.1 and @sentry version 7.26.0.

Versions 9.1.6 and 7.17.2 work fine.

The problem is probably somewhere between NestJS -> ntegral -> Sentry.

from nestjs-sentry.

yepMad avatar yepMad commented on July 30, 2024

@sentry/tracing not working either? Or it's the same package?

from nestjs-sentry.

AdamGerthel avatar AdamGerthel commented on July 30, 2024

@sentry/tracing not working either? Or it's the same package?

According to the Sentry docs for NodeJS, tracing is already enabled: https://docs.sentry.io/platforms/node/performance/#enable-tracing

from nestjs-sentry.

StPaulis avatar StPaulis commented on July 30, 2024

Has anyone managed to solve this issue?

I end up using the plain @sentry package.

I forked a repository with a generic nestjs implementation and develop this to support tracing.

from nestjs-sentry.

ossamaweb avatar ossamaweb commented on July 30, 2024

It appears that SentryService gets initiated twice. And because of that Sentry.init gets called twice also.

Screen Shot 2024-01-23 at 23 42 49

A workaround:

  1. Add fromFactory guard in sentry.service.ts constructor to initiate Sentry.
constructor(
    @Inject(SENTRY_MODULE_OPTIONS)
    readonly opts?: SentryModuleOptions,
    readonly fromFactory?: boolean
  ) {
    super();
   ...
   if (fromFactory) {  // <-- here
      Sentry.init(opts);
    }
  ...
}
  1. Add it to the Service instantiation in forRootAsync/ forRoot in sentry-core.module.ts
public static forRootAsync(options: SentryModuleAsyncOptions): DynamicModule {
    const provider: Provider = {
      inject: [SENTRY_MODULE_OPTIONS],
      provide: SENTRY_TOKEN,
      useFactory: (options: SentryModuleOptions) =>
        new SentryService(options, true), // <-- here
    };
   ...
}

from nestjs-sentry.

ossamaweb avatar ossamaweb commented on July 30, 2024

Has anyone managed to solve this issue?

@AdamGerthel @StPaulis check my workaround above.

from nestjs-sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.