nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
501 stars 114 forks source link

Sentry is always disabled. What am I doing wrong? #674

Closed sinneren closed 3 months ago

sinneren commented 3 months ago

Hello. I tried to call captureException, but get message: $sentry.captureException() called, but Sentry plugin is disabled...

Already tried different major versions of module: 7 & 8. Tried to set disabled option manually, but still got message and nothing in panel.

"@nuxtjs/sentry": "8.0.6"
"@nuxtjs/composition-api": "^0.33.1",
"dotenv": "^16.4.5",
"@sentry/webpack-plugin": "^2.16.0",
"nuxt": "2.17.0",

Config:

publicRuntimeConfig: {
sentry: {
      dsn: process.env.SENTRY_DSN,
      config: {
        environment: process.env.SENTRY_ENVIRONMENT,
        denyUrls: [
          // Chrome extensions
          /extensions\//i,
          /^chrome:\/\//i,
          /metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
          /google\.com\//i,
        ],
      },
    },
 }

nuxt2 with composition api, eg:

export default defineComponent({
  ...
  setup() {
    const { $sentry } = useContext();
    ....
    $sentry.captureException(name, err); // some call in client side
  }
})
rchl commented 3 months ago

From the documentation:

Currently, only the config, clientConfig and serverConfig options can be configured using the runtime config.