Open iliyaZelenko opened 4 years ago
I think the exception will be caught regardless.
The linked example is probably just an example of usage and an example of how to capture the exception and not make the page crash.
Do you actually have an issue with exceptions not being captured from asyncData
?
I was my mistake, in fact it seems to work.
I have another problem: the stacktrace in such an error looks very strange. I use souremaps, if an error occurs on the client side, then I can clearly see stacktrace.
Error in asyncData
:
Error on client side:
As you can see, on client side the stacktrace is clear, I can understand where the error occurred, on the server side everything is different. Are there any ways to improve this?
Yes, I think I might have had issues with that too (don't get server-side errors often so didn't bother analyzing).
I think it's a matter of either:
I'd need to analyze this at some point but any help is welcome.
This will very-very help in debugging errors, I have a lot of code on the server side and it is not possible to transfer it to the client side in order to finally see sourcemaps. I look forward to news on this topic, keep me posted. Thanks for the quick answers!
How i use module:
['@nuxtjs/sentry', {
publishRelease: true,
webpackConfig: {
silent: [process.env.IS_PROD, process.env.IS_TESTBB].includes('true')
}
}],
Also i have scuh env variables:
SENTRY_DSN=***
SENTRY_AUTH_TOKEN=***
SENTRY_ORG=sentry
SENTRY_PROJECT=***
# this defaults to https://sentry.io/.
SENTRY_URL=http://sentry.testbb.ru
I forgot to post here it seems but the issue is partially analyzed and seems a bit hard to fix without changes in Nuxt. See https://github.com/nuxt/nuxt.js/issues/7461 which talks about just local server-side debugging with source maps but it should be relevant.
(There is a chance that those issues are not related.)
@rchl any updates on this issue? We are facing this issue as well. We have a single sentry project where we send both node and JS issues to. We are using the latest version of the module but even though we specify in the publishRelease section the release name to be 'project@versionNumber' I can see in the sentry release file generated in The nuxt folder shows a sha key or similar.
Doesn't seem like a related issue (not creating releases properly vs. not able to see proper stack traces on server).
Sounds like a configuration issue. Create a new issue or discussion with all the details.
What problem does this feature solve?
It will not be necessary to use
$sentry.captureException(error)
to catch an error everywhere as described here, each error will be logged itself if it appears inasyncData
.What does the proposed changes look like?
I want the error to be caught through this module, for example, in this code:
That is, not to write like this: