Activities

BenJChen

BenJChen posted a new question

sentry-module •

sentry-module:Error while mounting app

Error while mounting app

when use sentry-module,it has a error,

app.js:519 Error: [nuxt] Error while mounting app: TypeError: _sentry_browser__WEBPACK_IMPORTED_MODULE_5__.Integrations.Dedupe is not a constructor

nuxt.config.js

modules:[
        '@nuxtjs/axios',
        '@nuxtjs/sentry',
        'cookie-universal-nuxt'
    ],
    axios: {
        proxy: true
    },
    sentry: {
        dsn: 'https://[email protected]/2', // Enter your project's DSN here
        config: {}, // Additional config
    },
loomchild

loomchild posted a new feature request

sentry-module •

idea Allow specifying the release when publishing sources

What problem does this feature solve?

Currently release config option is only used when reporting errors, but is ignored when publishRelease is active. The specified release should be taken into account when uploading sources instead of always relying on commit hash.

pi0

pi0 posted a new question

sentry-module •

[RFC] v3 checklist
  • Server side plugin support
  • Drop support for Nuxt 1.x
  • Improve default webpack config
  • Upgrade to [email protected]
pi0

pi0 posted a new feature request

sentry-module •

idea Support sever side integration

What problem does this feature solve?

Node integration and allow using $sentry in server side code

Related issues: #19, #33
Related PRs: #61

simllll

simllll posted a new feature request

sentry-module •

idea add typescript defintions for $sentry

What problem does this feature solve?

right now $sentry is not available in the context or in a component. therefore no typescript definition is associated when using this.$sentry or in any other context.

What does the proposed changes look like?

To solve this a proper typescript defintion is needed, right now to workaround this issue you simple can do:
1.) create a new "index.d.ts" file
2.) paste:

declare module 'vue/types/vue' {
interface Vue {
$sentry: any;
}
}
see also // https://vuejs.org/v2/guide/typescript.html#Augmenting-Types-for-Use-with-Plugins

but the correct solution would be not using "any", but the correct type. I tried it with:
import { NodeClient } from '@sentry/node';

but this collides with some other things, and actually it would be wrong on the client side too.

Could be the right way to provide a "unified" interface for both client&server and wrap the actual sentry calls behind it?

GexxOn

GexxOn posted a new question

sentry-module •

add typescript defintions for $sentry

right now $sentry is not available in the context or in a component. To solve this a proper typescript defintion is needed, right now to workaround this issue you simple can do:
1.) create a new "index.d.ts" file
2.) paste:

declare module 'vue/types/vue' {
    interface Vue {
        $sentry: any;
}
}

see also // https://vuejs.org/v2/guide/typescript.html#Augmenting-Types-for-Use-with-Plugins

but the correct solution would be not using "any", but the correct type. I tried it with:
import { NodeClient } from '@sentry/node';

but this collides with some other things, and actually it would be wrong on the client side too.

Could be the right way to provide a "unified" interface for both client&server and wrap the actual sentry calls behind it?

Regards
Gexxxn 3000

joergac

joergac posted a new bug report

sentry-module •

bug Error when publishRelease is enabled

Version

2.3.1

Reproduction link

https://github.com/nuxt-community/sentry-module/issues/31

Steps to reproduce

Add publishRelease like so

sentry: {
    dsn: 'https://[email protected]/xxxxxxx',
    publishRelease: true,
    options: {
      environment: env.SENTRY_ENV
    }
  },

What is expected ?

Publish a release on push

What is actually happening?

 [1m [31mERROR in Sentry CLI Plugin: Command failed: /home/forge/xxxxxx/node_modules/@sentry/cli/sentry-cli releases new xxxxxxd55334f3f4xxxxxxxxxxxxx
error: An organization slug is required (provide with --org)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
 [39m [22m

10:01:22  FATAL  Nuxt Build Error

  at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5262:15)
  at process._tickCallback (internal/process/next_tick.js:68:7)
shlima

shlima posted a new question

sentry-module •

Cannot read property 'config' of undefined

I'm trying to run @nuxt/sentry with nuxt v.2 but got the following error:

 FATAL  Cannot read property 'config' of undefined

  at ModuleContainer.sentry (node_modules/@nuxtjs/sentry/lib/sentry.js:28:75)
  at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:177:34)
  at promise.then (node_modules/@nuxt/utils/dist/utils.js:1664:43)
  at processTicksAndRejections (internal/process/next_tick.js:81:5)
  at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:51:3)
  at Function.Module.runMain (internal/modules/cjs/loader.js:865:11)
  at internal/main/run_main_module.js:21:11

Script fails at the following line https://github.com/nuxt-community/sentry-module/blob/master/lib/sentry.js#L51

It seems to be that config variable not defined

sh-misaki

sh-misaki posted a new question

sentry-module •

How to register the Nuxt instance in Sentry/Node?

When we build the Nuxt instance, we want to include node/sentry to it.

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

But, on this line, ssr: false is the fixed setting, so we can not get the errors on the ssr.

How should we do this?

benoitemile

benoitemile posted a new feature request

sentry-module •

idea About Client or Server logging

What problem does this feature solve?

We would be able to have specific monitoring and alerting on client side errors differently from server side errors.

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