ntegral / nestjs-sentry

Provides an injectable sentry.io client to provide enterprise logging nestjs modules
ISC License
377 stars 93 forks source link

Cannot read properties of undefined (reading 'OnUncaughtException') #127

Open mehdibo opened 6 days ago

mehdibo commented 6 days ago

Version: @ntegral/nestjs-sentry: 4.0.1

Usage:

SentryModule.forRootAsync({
      useFactory: async (
        config: ConfigService,
      ): Promise<SentryModuleOptions> => {
        return {
          dsn: config.get('SENTRY_DSN'),
          debug: process.env.NODE_ENV !== 'production',
          environment: process.env.NODE_ENV,
          release: APP_VERSION,
          logLevels: ['error', 'warn'],
        };
      },
      inject: [ConfigService],
    })

I am currently getting this error (it was working fine):

[Nest] 12757 - 07/02/2024, 10:15:50 PM ERROR [ExceptionHandler] Cannot read properties of undefined (reading 'OnUncaughtException') TypeError: Cannot read properties of undefined (reading 'OnUncaughtException') at new SentryService (/sentry.service.ts:25:33) at InstanceWrapper.useFactory [as metatype] (/sentry-core.module.ts:40:59) at Injector.instantiateClass (/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/injector.js:368:55) at callback (/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/injector.js:65:45) at Injector.resolveConstructorParams (/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/injector.js:144:24) at Injector.loadInstance (/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/injector.js:70:13) at Injector.loadProvider (/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/injector.js:97:9) at /nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/instance-loader.js:56:13 at async Promise.all (index 4) at InstanceLoader.createInstancesOfProviders (***/nestjs-api/nodemodules/.pnpm/@nestjs+core@10.3.10@nestjs+common@10.3.10_class-transformer@0.5.1_class-validator@0.14.1_re_mxy2umldb5kjaz5pxuunqqkrty/node_modules/@nestjs/core/injector/instance-loader.js:55:9)

pereslavtsev commented 6 days ago

the same problem (v4.0.1) sentry node v7 works fine - https://www.npmjs.com/package/@sentry/node/v/7.118.0

RafaPalau commented 6 days ago

Good morning. I have the same problem. Wouldn't it be possible to use Sentry v8? It seems that the error in @ntegral/nestjs-sentry would be in this part of the code. I think Integrations no longer exist in "@sentry/node" 8.13.0

2024-07-03_12-00

LWJerri commented 2 days ago

I have the same issue on the latest version of @sentry/node, but everything is ok on @sentry/node@7.117.0.