`Sentry.captureException` TypeScript types do not allow for basic usage
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/types
SDK Version
latest
Framework Version
No response
Link to Sentry event
No response
Steps to Reproduce
https://docs.sentry.io/platforms/javascript/enriching-events/context/
These docs demonstrate this usage:
Sentry.captureException(new Error("something went wrong"), {
tags: {
section: "articles",
},
});
Expected Result
TypeScript should be okay with this example code
Actual Result
Argument of type '{ tags: { section: string; } }' is not assignable to parameter of type 'EventHint'.
Object literal may only specify known properties, and 'tags' does not exist in type 'EventHint'.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Usage - Sentry Documentation
The simplest way, is to try and explicitly capture and report potentially problematic code with a try...catch block and Raven.captureException . JavaScript.
Read more >How to Add Sentry to Your Node.js Project with TypeScript
Sentry.io is an external monitoring and logging service which can help you identify and triage errors in your code.
Read more >@sentry/types | Yarn - Package Manager
Going forward, the @sentry/replay package doesn't have to be installed explicitly to use Replay. Furthermore, this release increases the maximim replay session ...
Read more >JavaScript - Docs - Sentry Documentation
Integrating the SDK. All our JavaScript-related SDKs provide the same API. Still, there are some differences between them, such as installation, ...
Read more >How to capture TypeScript Firebase functions errors in Sentry
An easy way to ensure that any error that occurs in a function is automatically sent to Sentry.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So is there no way to do something like this?
I’m looking for an interface that represents everything exported by the ~
@sentry/browser
~ Sentry JS library.Does
typeof
help here - or is there something else you’re doing here? Always happy to debug these things 😃