Comments (8)
Any news about that? I can confirm that the problem exists in 7.36.0
also.
from nestjs-sentry.
Has anyone managed to solve this issue?
from nestjs-sentry.
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.
@sentry/tracing
not working either? Or it's the same package?
from nestjs-sentry.
@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.
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.
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](https://private-user-images.githubusercontent.com/10572252/299123169-8f59aa35-6360-468f-8810-491faaa557c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5MzY5MzIsIm5iZiI6MTcyMTkzNjYzMiwicGF0aCI6Ii8xMDU3MjI1Mi8yOTkxMjMxNjktOGY1OWFhMzUtNjM2MC00NjhmLTg4MTAtNDkxZmFhYTU1N2M0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDE5NDM1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQyZTRhNTQ4MGIxYzdjYTJjNDY5M2Q3NGNkZDEyNDQ4NTQyMWRhOGI3ODU2ZTkwYjc0YjE4OWQyZTllNWJiYTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.28NESAoa5X0TUuzXoyyqimFSfLwxk6qdgS91r_1vU4s)
A workaround:
- 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);
}
...
}
- 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.
Has anyone managed to solve this issue?
@AdamGerthel @StPaulis check my workaround above.
from nestjs-sentry.
Related Issues (20)
- Custom exception does not work in SentryInterceptor HOT 4
- Exception objectError does not work
- unmet peer rimraf@^3.0.2: found 4.1.2
- Make app name in sentryService customizable HOT 1
- Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'
- Is this project still maintained? HOT 7
- nestjs 10 support HOT 5
- Getting error in the latest version of nestjs (v10) HOT 6
- Remove 'rimraf' unused dependency HOT 1
- Request for Updating 'reflect-metadata' Package Version in Project HOT 2
- Can not install in NestJS 9
- Official Sentry Nest.js support in `8.x` of the Sentry SDK HOT 4
- Cannot read properties of undefined (reading 'OnUncaughtException') HOT 3
- NestJs 9 Support HOT 7
- How to inject into another module? HOT 4
- Why does my Sentry errors look like this? HOT 1
- Add Performance Tracking HOT 3
- Integrate Sentry Prisma ORM HOT 2
- Update imports of `@sentry/hub` to use `@sentry/core`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestjs-sentry.