Activities

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
eseceve

eseceve posted a new question

sentry-module •

How to use sentry on vuex action (serverside)

Hi, I trying to use $sentry from a vuex action but it's undefined when action is called from asyncData

store/index.js

async foo({ commit, state }) {
   const response = await this.$axios.$get('/foo/')
   this.$sentry.captureMessage('Test foo', { extra: { response }})
}

package.json

"@nuxtjs/sentry": "^2.0.0",
"nuxt": "^2.2.0",

nuxt.config.js

  // read dsn from process.env.SENTR_DSN
  sentry: {
    disabled: false,
    config: {
      debug: true
    }
  }
tillkruss

tillkruss posted a new question

sentry-module •

413 Error

I'm running into HTTP Error (413) exceptions because the payload is too big.

Screen Shot 2018-10-26 at 9.10.55 AM.png

simllll

simllll posted a new question

sentry-module •

Webpack Sentry plugin for sourcemaps

See https://github.com/40thieves/webpack-sentry-plugin

Would be great if this module does this also.

sdr0x07b6

sdr0x07b6 posted a new question

sentry-module •

pretty-error <-- nuxt <-- loud-rejection <-- raven

In my project occasionally "pretty-error" caused errors.
Because "pretty-error" is used directly by Nuxt, I don't know where to fix🤔

"raven" appears in the back trace.
I am using "@nuxtjs/sentry" v1.1.3, but is this a problem?

  • nuxt v1.4.2
TypeError: Cannot read property 'wrapper' of undefined
    at ParsedError.module.exports.ParsedError._parse (/Users/sdr/myproj/node_modules/pretty-error/lib/ParsedError.js:17:20)
    at new ParsedError (/Users/sdr/myproj/node_modules/pretty-error/lib/ParsedError.js:9:10)
    at PrettyError.module.exports.PrettyError.getObject (/Users/sdr/myproj/node_modules/pretty-error/lib/PrettyError.js:357:11)
    at PrettyError.module.exports.PrettyError.render (/Users/sdr/myproj/node_modules/pretty-error/lib/PrettyError.js:346:16)
    at Object.exports.renderError (/Users/sdr/myproj/node_modules/nuxt/lib/common/utils.js:15:29)
    at Object.exports.printError (/Users/sdr/myproj/node_modules/nuxt/lib/common/utils.js:22:25)
    at process.on._error (/Users/sdr/myproj/node_modules/nuxt/bin/nuxt:14:9)
    at process.emit (events.js:187:15)
    at processEmit [as emit] (/Users/sdr/myproj/node_modules/signal-exit/index.js:155:32)
    at emitPromiseRejectionWarnings (internal/process/promises.js:105:20)
    at process._tickCallback (internal/process/next_tick.js:69:34)
Error: Promise rejected with value: undefined
    at /Users/sdr/myproj/node_modules/loud-rejection/index.js:27:12
    at Array.forEach (<anonymous>)
    at EventEmitter.<anonymous> (/Users/sdr/myproj/node_modules/loud-rejection/index.js:23:24)
    at EventEmitter.emit (events.js:182:13)
    at EventEmitter.emit (domain.js:442:20)
    at emit (/Users/sdr/myproj/node_modules/signal-exit/index.js:77:11)
    at processEmit [as emit] (/Users/sdr/myproj/node_modules/signal-exit/index.js:150:5)
    at process.exit (internal/process/per_thread.js:168:15)
    at Raven.onFatalError.defaultOnFatalError (/Users/sdr/myproj/node_modules/raven/lib/client.js:101:22)
    at /Users/sdr/myproj/node_modules/raven/lib/client.js:180:18
    at ClientRequest.<anonymous> (/Users/sdr/myproj/node_modules/raven/lib/transports.js:53:13)
    at Object.onceWrapper (events.js:273:13)
    at ClientRequest.emit (events.js:187:15)
    at ClientRequest.EventEmitter.emit (domain.js:442:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:555:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at TLSSocket.socketOnData (_http_client.js:441:20)
    at TLSSocket.emit (events.js:182:13)
    at TLSSocket.EventEmitter.emit (domain.js:442:20)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at TLSSocket.Readable.push (_stream_readable.js:219:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
error Command failed with exit code 1.
ThomasKientz

ThomasKientz posted a new question

sentry-module •

created hook: "TypeError: Cannot read property 'captureException' of undefined"

Hi,

I got the following error :

created hook: "TypeError: Cannot read property 'captureException' of undefined"

I am simply calling this.$raven inside a created() hook :

created() {
    this.$raven.captureException(this.error);
  },

Otherwise I am receiving issues so its looks well configured.

Am I missing something ?

crutch12

crutch12 posted a new question

sentry-module •

Can't use $raven anywhere except front vue components

How can I use .$raven in:

  • store methods
  • asyncData/fetch
    ?

I want to user .setUserContext in store, but can, because store and context dont have .$raven prop

Thx

mauxtin

mauxtin posted a new question

sentry-module •

How to use captureException?

Is there any way to do something like that? This is inside a method.
At this point I am getting the error
Uncaught (in promise) TypeError: Cannot read property 'captureException' of undefined

   this.$axios.post('/endpoint', data).then((response) => {
    //
   }).catch((error) => {
       if (error.response.status !== 422) {
         this.$raven.captureException(error)
       }
    })
benoitemile

benoitemile resolved the question #c18

sentry-module •

Sentry module : Splitting client/server errors

you can mark this as resolved