Activities

rchl

rchl posted a new feature request

sentry-module •

idea "Errors will not be logged" log doesn't indicate where it's coming from

What problem does this feature solve?

The Errors will not be logged because the disable option has been set console log that triggers on starting nuxt app doesn't indicate what module it's coming from so it looks like it's a message triggered by nuxt itself. I think it would be nice to indicate that it's sentry module saying that.

What does the proposed changes look like?

Prefix strings (two instances) with [sentry-module] maybe.

rchl

rchl posted a new question

sentry-module •

"Errors will not be logged" log doesn't indicate where it's coming from

The Errors will not be logged because the disable option has been set console log that triggers on starting nuxt app doesn't indicate what module it's coming from so it looks like it's a message triggered by nuxt itself. I think it would be nice to indicate that it's sentry module saying that.

tic40

tic40 posted a new bug report

sentry-module •

bug disabled option does not work

Version

v2.2.1

Reproduction link

https://jsfiddle.net/y5sa4ht8/

Steps to reproduce

Set the following sentry config in nuxt.config.js.

{
  sentry: {
    dsn: 'dsn',
    disabled: true,
    config: {
      environment: process.env.NODE_ENV // 'development'
    }
  }
}

What is expected ?

I expect that sentry-module does not send error reports because disabled option is true.

What is actually happening?

Though I set disabled: true, sentry-module sends error reports.

Additional comments?

This works well on v2.1.0. I met this on v2.2.1.

vsetka

vsetka posted a new bug report

sentry-module •

bug Redundant DSN required in configuration to initialize Sentry

Version

2.2.1

Reproduction link

https://jsfiddle.net/dg37h4wa/

Steps to reproduce

Create a config in nuxt.config.js

{
  sentry: {
    dsn: 'my_dsn',
    config: {
      environment: 'staging'
    }
  }
}

Sentry will not initialize because it checks for both options.dsn AND options.config.dsn (https://github.com/nuxt-community/sentry-module/blob/master/lib/sentry.js#L26) so to make it work, we must add the dsn twice, like so:

{
  sentry: {
    dsn: 'some_dsn',
    config: {
      environment: 'staging',
      dsn: 'my_dsn'
    }
  }
}

What is expected ?

Sentry is initialized when dsn is set in options

What is actually happening?

Sentry gets initialized only when the dsn prop is set in the top level options AND the additional config options

Additional comments?

Your issue reporting is very involved and cumbersome (why is reproduction required even in simple cases such as this one?). It deters from even reporting a bug. If you insist on such a model, at least make sure that everything works then. For example, fetching the version of this module doesn't work and it lists no versions for sentry-module (https://cmty.app/api/communities/nuxt/repos/sentry-module/releases/search)

inkusu

inkusu posted a new question

sentry-module •

Is additional config setting page old?

c92bf911679c9aa573a27f1b4272a0f5.png
Is It the link not older?

c4ss

c4ss posted a new feature request

sentry-module •

idea Prevent undefined this.$sentry while offline test

What problem does this feature solve?

Currently this module will completely avoid creating this.$sentry when there is no DSN specified or the disabled option is flagged - this causes any this.$sentry.xxx functions to error and completely prevents offline debugging without sentry reporting.

For local testing no error reporting is necessary as the console log is accessible to us and will end up clogging issues being reporting from real users

What does the proposed changes look like?

serverless-sentry-lib achieves this by deleting the DSN and installing nonetheless (although this uses the deprecated Raven package).

lupas

lupas posted a new question

sentry-module •

Disable Sentry in local environment and still log errors to console

I really like this module, thanks a lot for maintaining it!

However, when developing in localhost I prefer not to log to sentry, since that's costly and I don't need these errors to be logged. I would prefer these errors to be logged to the console instead.

Now I tried to disable the module in dev like mentioned in #21 by setting the DNS to an empty string or null, but that throws the following error: [nuxt] Error while initializing app TypeError: Cannot read property 'captureException' of undefined.

I also tried it with the config disabled = true, but there I get the same error.

So two questions:
1) Is there a way to disable sentry without having to put every this.$sentry.captureException in a if(env === 'prd') so it does not throw this error? Might I be doing something wrong?

2) If Sentry is disabled -> is there a possibility to log to the console instead? Or would I have to add a console.error(e) manually before every captureException? That would be a great addition if this is not done automatically.

That's all, Thanks a lot!

This is my config:

export default function getSentryConfig(BASE_DATA) {
  const ENV = process.env.ENV
  const sentryEnabled = ENV === 'prd'

  return {
    dsn: BASE_DATA.config.sentry.dns,
    disabled: true,
    config: {
      environment: ENV,
      release: BASE_DATA.version,
      ignoreErrors: [
       // some errors
      ],
      ignoreUrls: [
       // some urls
      ]
    }
  }
}

And I usually do this in async data:

catch (e) {
    app.$sentry.captureException(e)
    return error({ statusCode: 500 })
}

And this everywhere else:

catch (e) {
    this.$sentry.captureException(e)
    //handle error somehow       
}
BobNobrain

BobNobrain posted a new question

sentry-module •

Am I able to use it from vuex actions?

I try to use it from vuex actions like this:

// this is inside vuex 'login' action
this.$sentry.configureScope(scope => {
      scope.setUser({ username, id });
});

But this.$sentry is undefined. Am I doing something wrong?

Or maybe I should provide user information to the plugin not when user logs in, but somewhere else?

kamontat

kamontat posted a new bug report

sentry-module •

bug I cannot use it, `this.$sentry` is undefined

Version

2.1.0

Reproduction link

https://google.com

Steps to reproduce

I cannot use it, this.$sentry is undefined,

What is expected ?

able to capture log

What is actually happening?

error

seandelaney

seandelaney posted a new question

sentry-module •

$sentry is undefined within Nuxt plugin

Simple Nuxt plugin, where I want to include ctx.app.$sentry but $sentry is undefined.

If I console.log(ctx.app), I can see $sentry listed/available alongside $axios and other Nuxt modules.

this.$sentry works fine with Vue Components.

But doesnt seem to be available within a plugin?

import Logger from '../services/Logger'

export default (ctx, inject) => {
  const logger = new Logger({
    sentry: ctx.app.$sentry
  })

  ctx.$logger = logger

  inject('logger', logger)
}

Please advise

Thanks
Sean

robyedlin

robyedlin posted a new bug report

sentry-module •

bug Sentry module no longer shows user agent, breadcrumbs, or any default integrations

Version

2

Steps to reproduce

  1. Create a new nuxt 2 project.
  2. Add @sentry module 2.0.0
  3. Add error
  4. Capture error

What is expected ?

Sentry should

  • Show user agent information
  • Show breadcrumbs

What is actually happening?

Sentry is not

  • Showing user agent information
  • Showing breadcrumbs

Additional comments?

https://github.com/nuxt-community/sentry-module/blob/master/lib/templates/sentry-client.js#L6

This is passing default integrations from the node version: https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/sdk.ts#L8-L21, but should be pulling from the browser version: https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/sdk.ts#L6-L19

ThomasKientz

ThomasKientz posted a new question

sentry-module •

Access from plugin context clientside

I am trying to automatically track network errors.

export default function({ $axios, store, error, $raven }) {
  $axios.onError(e => {
    if (process.client) {
      $raven.captureException(e.response.data);
    }
    return Promise.reject(e);
  });
}

But $raven is undefined.

Any ideas ? I have read https://github.com/nuxt-community/sentry-module/issues/19 but I don't find the solution.

Thanks

tanakaworld

tanakaworld posted a new bug report

sentry-module •

bug TypeError: this.$sentry.setUserContext is not a function

Version

v2.0.0

Reproduction link

https://github.com/tanakaworld/nuxt-vue-error-handling-demo

Steps to reproduce

Nuxt is v2.2.0.

  1. Clone source code from reproduction link
  2. Check out 'verify' branch
  3. Setup according to README, and run 'npm run dev'
  4. The error will happen at here

Screenshot 2018-11-11 00.06.08.png

What is expected ?

We can use a method 'this.$sentry.setUserContext'.

What is actually happening?

We can use a method 'this.$sentry.setUserContext'.

manniL

manniL resolved the question #c31

sentry-module •

What is the best way to send user information together when an exception occurs?

@usacoasts Please use CMTY and use code formatting for your issues.

usacoasts

usacoasts posted a new question

sentry-module •

What is the best way to send user information together when an exception occurs?

Hello ! Thank you for the nice module

I understood how to transmit user information with this question.
(https://cmty.app/nuxt/sentry-module/issues/c30)

But the way to write the user information in one point and send the user information together at the time of error occurrence isn't understood.

The way which thought of only one and put it into effect was a way using middleware, but this didn't go well by the following reason.
and nuxt is being used in SSR, not SPA.


serverMiddleware vs middleware!
(https://nuxtjs.org/api/configuration-servermiddleware/)

Don't confuse it with routes middleware which are being called before each route by Vue in Client Side or SSR. serverMiddleware are just running in server side before vue-server-renderer and can be used for server specific tasks like handling API requests or serving assets.

Even the way mentioned in ※code1 experimented on a project, but you didn't send one in case of the error which occurred by a different component to the user information.
Project/layouts/default.vue is a layout file, so it'll be a parent of all templates.

I'm sorry, could you inform me about the way to send the user information together at the time of error occurrence?

Thank You!


(※code1 ) (Project/layouts/default.vue)

export default {
head () {
const viewport = this.$device.isMobile
? 'width=device-width, initial-scale=1'
: 'width=1336'
return {
meta: [
{ hid: 'viewport', name: 'viewport', content: viewport },
{ hid: 'author', name: 'author', content: this.baseinfo.metaauthor },
{ hid: 'description', name: 'description', content: this.baseinfo.metadescription },
{ hid: 'keywords', name: 'keywords', content: this.baseinfo.metakeyword },
{ hid: 'options', name: 'options', content: this.baseinfo.metaoptions }
]
}
},
mixins: [HandleAfterLogin],
components: {
GeneralHeader,
GeneralFooter,
GeneralLoading,
MobileHeader
},
mounted () {
this.$sentry.configureScope(scope => {
scope.setUser({id: 1, username: 'test', email: '[email protected]'})
});
},
computed: {
…mapState('global', ['base_info'])
}
}

usacoasts

usacoasts posted a new question

sentry-module •

What is the best way to send user information together when an exception occurs?

Hello ! Thank you for the nice module

I understood how to transmit user information with this question.
(https://cmty.app/nuxt/sentry-module/issues/c30)

But the way to write the user information in one point and send the user information together at the time of error occurrence isn't understood.

The way which thought of only one and put it into effect was a way using middleware, but this didn't go well by the following reason.
and nuxt is being used in SSR, not SPA.

serverMiddleware vs middleware!

(https://nuxtjs.org/api/configuration-servermiddleware/)

Don't confuse it with routes middleware which are being called before each route by Vue in Client Side or SSR. serverMiddleware are just running in server side before vue-server-renderer and can be used for server specific tasks like handling API requests or serving assets.

Even the way mentioned in ※code1 experimented on a project, but you didn't send one in case of the error which occurred by a different component to the user information.
Project/layouts/default.vue is a layout file, so it'll be a parent of all templates.

I'm sorry, could you inform me about the way to send the user information together at the time of error occurrence?

Thank You!


(※code1 ) (Project/layouts/default.vue)

export default {
head () {
const viewport = this.$device.isMobile
? 'width=device-width, initial-scale=1'
: 'width=1336'
return {
meta: [
{ hid: 'viewport', name: 'viewport', content: viewport },
{ hid: 'author', name: 'author', content: this.baseinfo.metaauthor },
{ hid: 'description', name: 'description', content: this.baseinfo.metadescription },
{ hid: 'keywords', name: 'keywords', content: this.baseinfo.metakeyword },
{ hid: 'options', name: 'options', content: this.baseinfo.metaoptions }
]
}
},
mixins: [HandleAfterLogin],
components: {
GeneralHeader,
GeneralFooter,
GeneralLoading,
MobileHeader
},
mounted () {
this.$sentry.configureScope(scope => {
scope.setUser({id: 1, username: 'test', email: '[email protected]'})
});
},
computed: {
…mapState('global', ['base_info'])
}

}

aldarund

aldarund resolved the question #c30

sentry-module •

Sentry's method cannot be called in this.$century

@usacoasts u can try

this.$sentry.configureScope(scope => {
  scope.setTag("a", "b");
});

Let me know if that worked

usacoasts

usacoasts posted a new question

sentry-module •

Sentry's method cannot be called in this.$century

Hello ! Thank you for the nice module

An error occurs when trying to invoke a method on an instance
Notifications are sent to sentry when an error occurs.

@ sentry / browser module' method can not be used because it can not be sent with user information etc., I am in trouble

Would you please help me?

Thank you

(example)
this.$sentry.setUserContext({{
id: 1,
username: 'test',
email: '[email protected]'
}})

this.$sentry.captureException(new Error('error test'))

Exception

TypeError: this.$sentry.setUserContext is not a function
at VueComponent.mounted (/nuxt/pages/product/id.js:1740:18)
at callHook (/nuxt/commons.app.js:13354:21) at Object.insert (/nuxt/commons.app.js:14587:7)
at invokeInsertHook (/_nuxt/commons.app.js:16382:28)
at Vue.patch as patch

(13 additional frame(s) were not displayed)
Exception

TypeError: Cannot read property 'captureException' of undefined
at VueComponent.mounted (/nuxt/pages/product/id.fa1f7c3d171eb5ab5250.hot-update.js:160:17)
at callHook (/nuxt/commons.app.js:13354:21) at insert (/nuxt/commons.app.js:14587:7)
at Object.invoker as insert
at invokeInsertHook (/_nuxt/commons.app.js:16382:28)

(8 additional frame(s) were not displayed)
package.json

"@nuxtjs/sentry": "^2.0.0",
"nuxt": "^2.2.0",
nuxt.config.js

usacoasts

usacoasts posted a new question

sentry-module •

mistake
usacoasts

usacoasts posted a new question

sentry-module •

mistake