Closed arkhamvm closed 1 year ago
Good catch. The logic of merging default/user/server config was backwards that resulted in the global dsn
having priority. Fixed in #568.
BTW. The ignore
setting doesn't apply where you've put it. It's part of the publishRelease
object and defaults to:
ignore: [
'node_modules',
'.nuxt/dist/client/img',
],
already so maybe you shouldn't even override it.
And if you are not using publishRelease
then you can just remove it.
@rchl Can you also check perfomance tracing? Looks like it's same issue.
https://codesandbox.io/p/sandbox/hopeful-knuth-bou0pb?file=%2Fpages%2Fabout%2Findex.vue%3A15%2C42
VueJS tracing is OK:
NodeJS tracing not working:
Can you apply this patch in node_modules/@nuxtjs/sentry/dist/module.mjs
and see what is printed on starting Nuxt? It should tell you exactly what config is used and whether it's a config issue.
--- /node_modules/@nuxtjs/sentry/dist/module.mjs Wed May 10 14:45:01 2023
+++ /node_modules/@nuxtjs/sentry/dist/module.mjs Fri May 19 09:07:12 2023
@@ -532,6 +532,7 @@
const config = defu({ release }, serverOptions.config);
process.sentry = Sentry;
if (canInitialize(moduleOptions)) {
+ console.info({config})
Sentry.init(config);
sentryHandlerProxy.errorHandler = Sentry.Handlers.errorHandler();
sentryHandlerProxy.requestHandler = Sentry.Handlers.requestHandler(moduleOptions.requestHandlerConfig);
prod build
$ npm run build
✔ Sentry reporting is enabled (client side: enabled, server side: enabled)
ℹ Production build
ℹ Bundling for server and client side
ℹ Target: server
✔ Builder initialized
✔ Nuxt files generated
sentry_config {
config: {
dsn: 'SERVER_DSN',
integrations: [
[Http],
[Dedupe],
[ExtraErrorData],
[RewriteFrames],
[Transaction]
],
environment: 'production',
tracesSampleRate: 1,
}
}
dev watch
$ npm run dev
✔ Sentry reporting is enabled (client side: enabled, server side: enabled)
ℹ Preparing project for development
ℹ Initial build may take a while
✔ Builder initialized
✔ Nuxt files generated
sentry_config {
config: {
dsn: 'SERVER_DSN',
integrations: [
[Dedupe],
[ExtraErrorData],
[RewriteFrames],
[Transaction]
],
environment: 'dev'
}
}
DSN looks ok, but why tracesSampleRate
disappears in dev env?\
As well [Http]
integration too.
Config:
sentry: {
dsn: 'CLIENT_DSN',
serverConfig: {
dsn: 'SERVER_DSN',
},
lazy: false,
disabled: false,
tracing: {
tracesSampleRate: 1.0,
},
config: {
environment: sentryEnv,
},
ignoreErrors: [
'Non-Error exception captured',
'Non-Error promise rejection captured',
'Network Error',
'Request aborted',
],
clientIntegrations: {
ReportingObserver: false,
},
},
Off... this needs a proper look. :)
BTW. ignoreErrors
is in a wrong place. Should be in config/clientConfig/serverConfig.
Version
@nuxtjs/sentry: 7.2.4 nuxt: 2.15.8
Sentry configuration
Reproduction Link
https://codesandbox.io/p/sandbox/zealous-blackburn-00w1y6?file=%2Fpages%2Fabout%2Findex.vue%3A28%2C4
Steps to reproduce
Open
about
pageWhat is Expected?
Server Error sended to
dsn
fromserverConfig
What is actually happening?
Server Error sended to default
dsn