Activities

njbarrett

njbarrett posted a new question

sentry-module •

Setting a custom handleError

Hello, I've looked through the docs and I can't work out where the best place to add my own custom handleError function would be?

iliyaZelenko

iliyaZelenko posted a new feature request

sentry-module •

idea Fix stacktrace and source maps for servedside

What problem does this feature solve?

It will not be necessary to use $sentry.captureException(error) to catch an error everywhere as described here, each error will be logged itself if it appears in asyncData.

What does the proposed changes look like?

I want the error to be caught through this module, for example, in this code:

async asyncData ({ params }) {
  if (params.id === '123') throw Error('Test error')

  someFunctionThatCanThrowError()
}

That is, not to write like this:

async asyncData ({ params }) {
  if (params.id === '123') {
    $sentry.captureException(Error('Test error'))
  }

  try {
    someFunctionThatCanThrowError()
  } catch (e) {
    $sentry.captureException(e)
  }
}
ValdoGhafoor

ValdoGhafoor posted a new question

sentry-module •

How to configure release publishing right ?

Hi,
I wanted to use the plugin but as I'm not used to Sentry, there are few things that I don't get from the doc of this module.
In the options, there is a "config" Object, containing by default the "environment" key.
Is this the default Sentry config that is used in Sentry.init function ?

If so, why are some options out of this object, like dsn for exemple ?

Thank you in advance for your time

sajadhsm

sajadhsm posted a new feature request

sentry-module •

idea Allow overriding webpack plugin urlPrefix

What problem does this feature solve?

If build.publicPath is pointing to a CDN, then the urlPrefix is not correct. Being able to override it, is necessary in this situation.

What does the proposed changes look like?

Maybe a quick fix would be:

if (!options.webpackConfig.urlPrefix) {
    const publicPath = posix.join(this.options.router.base, this.options.build.publicPath)
    options.webpackConfig.urlPrefix = publicPath.startsWith('/') ? `~${publicPath}` : publicPath
}

or setting the urlPrefix before merging the options.

I can submit a PR if the solution is OK.

emaadali

emaadali posted a new question

sentry-module •

How can I use the beforeSend hook?

I am trying to show the user feedback screen on a bug as described here: https://docs.sentry.io/enriching-error-data/user-feedback/?platform=browser but I don't know where to put the beforeSend hook.

brokenthorn

brokenthorn posted a new bug report

sentry-module •

bug import '@nuxtjs/sentry' causes failure to compile

Version

v4.0.1

Reproduction link

https://codesandbox.io/s/aged-frog-vsgpy?file=/pages/index.vue

Steps to reproduce

  1. Creat an empty NuxtJS project using the latest version.
  2. Add @nuxtjs/sentry to dependencies.
  3. Add @nuxtjs/sentry to nuxt.config.js modules section.
  4. $sentry is not available on the Nuxt context automatically so try to import definitions by adding import '@nuxtjs/sentry' to a Nuxt page/component.
  5. With line added at 4., build fails. Without it it works but build warns about undefined $sentry (just a type check, the object is in fact there).

What is expected ?

Successful build.

What is actually happening?

× Client
Compiled with some errors in 4.93s

√ Server
Compiled successfully in 2.97s

i Type checking in progress… nuxt:typescript 05:55:31

ERROR Failed to compile with 7 errors friendly-errors 05:55:31

These dependencies were not found: friendly-errors 05:55:31
friendly-errors 05:55:31

  • childprocess in ./nodemodules/@sentry/cli/js/helper.js friendly-errors 05:55:31
  • console in ./node_modules/@sentry/node/esm/integrations/console.js friendly-errors 05:55:31
  • fs in ./nodemodules/@sentry/node/esm/parsers.js, ./nodemodules/@sentry/node/esm/integrations/modules.js and 1 other friendly-errors 05:55:31
  • net in ./node_modules/https-proxy-agent/index.js friendly-errors 05:55:31
  • tls in ./nodemodules/https-proxy-agent/index.js friendly-errors 05:55:31 friendly-errors 05:55:31 To install them, you can run: npm install --save childprocess console fs net tls friendly-errors 05:55:31
    i Waiting for file changes 05:55:31
    {"level":30,"time":1587351331741,"pid":16248,"hostname":"baby","msg":"Server listening at http://0.0.0.0:3001","v":1}

Additional comments?

Developing on Windows 10.

malkhuzayyim

malkhuzayyim posted a new question

sentry-module •

publishRelease & Source Maps, a question about environment awareness

First time using @nuxt/sentry, sorry if this is a naive question.

I'm using this setup currently:

  sentry: {
    dsn: "https://[email protected]/xxxxxx",
    publishRelease: process.env.NODE_ENV !== "development",
    sourceMapStyle: "hidden-source-map",
    config: {
      environment: process.env.NODE_ENV,
    },
  },

Would this work fine if I wish to publish releases for both staging & production?

Or does sentry only hold 1 source map per project and disregards the environment variable from config?

And one final question, does the module take care of of the whole publishing process? Nothing special is required beyond this setup? ie. i dont have to provide my own release tags or something, I assume?

prillymonials

prillymonials posted a new question

sentry-module •

Filtering issues in Sentry

So I read the Sentry documentation there is a beforeEach config (https://docs.sentry.io/error-reporting/configuration/filtering/?platform=javascript)
Can I know how to use this in this repo?
Thanks

Thooto

Thooto posted a new question

sentry-module •

Provide configuration for browser/node integrations

Currently, the only integrations available for configuration in the nuxt.config.js file seem to be the ones in @sentry/integrations.

But for example I would like to use the UserAgent integration, which is available in @sentry/browser.

Is there a clean way I can specify those integrations in the config file or anywhere else?

matthieusieben

matthieusieben posted a new bug report

sentry-module •

bug Publish 3.3.0 to npm

Version

v3.3.0

Reproduction link

https://www.npmjs.com/package/@nuxtjs/sentry

Steps to reproduce

npm install @nuxtjs/sentry

What is expected ?

Version 3.3.0 to be installed

What is actually happening?

Version 3.2.4 installed

matthieusieben

matthieusieben posted a new question

sentry-module •

Publish 3.3.0 to NPM

Please 😊

bjesus

bjesus posted a new bug report

sentry-module •

bug exception.values.0.stacktrace.frames: Missing value for required attribute

Version

v3.2.4

Reproduction link

https://sweeps.ai

Steps to reproduce

install the Sentry module
have some issues
look at the Sentry dashboard

What is expected ?

to be able to see details about the issues

What is actually happening?

very little information displayed, an error saying: There was 1 error encountered while processing this event: exception.values.0.stacktrace.frames: Missing value for required attribute appears.

Additional comments?

My config looks like this:
sentry: { dsn: "https://[email protected]/xxx", initialize: process.env.NODE_ENV === "production", publishRelease: true, webpackConfig: { setCommits: { repo: "sweeps/website", auto: true } }, config: {} // Additional config },

I also get tons of errors because everytime a user with ublock origin goes on the website some requests are blocked and that generates a "Failed to fetch" error on Sentry, but i'm not sure if that's a general sentry issue or sentry-module one.

hinaloe

hinaloe posted a new question

sentry-module •

Version 3.3.0 is not published

v3.3.0 was tagged 1 week ago, but it looks not published to npm.

dhritzkiv

dhritzkiv posted a new question

sentry-module •

How to avoid disabled console warning?

In development, I prefer to disable Sentry. However, in the latest version, each request prints out

WARN  $sentry.configureScope() called, but sentry plugin is disabled. Arguments: [
  [Function (anonymous)]
]

Which is quite annoying. Is there a way to have this pop up only once for the server instance, or disable this warning altogether?

JakubKoralewski

JakubKoralewski posted a new bug report

sentry-module •

bug SyntaxError: Cannot use import statement outside a module

Version

v3.2.4

Steps to reproduce

  1. Deploy this branch to Netlify: https://github.com/JakubKoralewski/mireks/tree/feature/fixes

What is expected ?

to work

What is actually happening?

3:38:21 PM: > [email protected]1.0.0 generate /opt/build/repo
3:38:21 PM: > nuxt-ts generate && rimraf dist/**/*.js.map
3:38:24 PM:  FATAL  Cannot use import statement outside a module
3:38:24 PM:   import { resolve, join } from 'path'
3:38:24 PM:   ^^^^^^
3:38:24 PM:   SyntaxError: Cannot use import statement outside a module
3:38:24 PM:   at Object.compileFunction (vm.js:379:18)
3:38:24 PM:   at Generator.next (<anonymous>)
3:38:24 PM:    ╭───────────────────────────────────────────────────────────────╮
3:38:24 PM:    │                                                               │
3:38:24 PM:    │   ✖ Nuxt Fatal Error                                          │
3:38:24 PM:    │                                                               │
3:38:24 PM:    │   SyntaxError: Cannot use import statement outside a module   │
3:38:24 PM:    │                                                               │
3:38:24 PM:    ╰───────────────────────────────────────────────────────────────╯

Additional comments?

only happens on Netlify, works fine on my machine :/ node version is the same, npm version is the same, tried deleting package-lock and node-modules and reinstalling didnt help

both netlify and my machine have NODE_ENV set to development, and actually a sidenote I don't understand why Sentry logging is enabled on Netlify even though in the config it states it should be disabled when development is set on NODE_ENV and Netlify says by default it is development and I dont change it manually so I don't know why that works

Happened after I migrated from nuxt 2.0.0 to 2.11.0 and @nuxtjs/sentry from 3.0.0 to 3.2.4.

Pull request with all the changes available here.

kimulaco

kimulaco posted a new bug report

sentry-module •

bug Specifying string in webpackConfig.inclide results in an error.

Version

3.2.2

Reproduction link

https://codesandbox.io/s/nuxt-sentry-module-r7wtc?fontsize=14&hidenavigation=1&theme=dark

Steps to reproduce

  1. Install @nuxtjs/sentry and add the following config to nuxt.config.js.
export default {
  ...
  modules: ['@nuxtjs/sentry'],
  sentry: {
    dsn: process.env.SENTRY_DSN || '',
    disableServerSide: true,
    disableServerRelease: true,
    config: {
      environment: 'dev'
    },
    webpackConfig: {
      include: '.',
      release: 'v1.0.0'
    },
  }
  ...
}
  1. Run nuxt generate or nuxt build.
  2. I get the following error in terminal.
 ✖ Nuxt Fatal Error
TypeError: options.webpackConfig.include.push is not a function     

What is expected ?

As with @ sentry/webpack-plugin, it is desirable that a string is allowed.
https://github.com/getsentry/sentry-webpack-plugin/blob/master/README.md#options

What is actually happening?

webpackConfig.include only allows arrays.

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

BastienMbz

BastienMbz posted a new bug report

sentry-module •

bug Proxy error in IE 11 (sentry disabled)

Version

v3.2.0

Reproduction link

https://jsfiddle.net/

Steps to reproduce

Create new Nuxt project.
Install @nuxtjs/sentry >= 3.2.0

Disable sentry in the configuration

sentry: {
    disabled: process.env.NODE_ENV !== 'production',
  }

Open the project in IE 11

What is expected ?

The project should work as in 3.1.0

What is actually happening?

The following error occured : "Proxy is not defined"

ReferenceError: « Proxy » est indéfini
   {
      [functions]: ,
      __proto__: { },
      description: "« Proxy » est indéfini",
      message: "« Proxy » est indéfini",
      name: "ReferenceError",
      number: -2146823279,
      stack: "ReferenceError: « Proxy » est indéfini
   at __webpack_exports__.default (eval code:27:3)
   at _callee2$ (eval code:393:13)
   at tryCatch (eval code:45:7)
   at invoke (eval code:271:9)
   at prototype[method] (eval code:97:9)
   at asyncGeneratorStep (eval code:5:5)
   at _next (eval code:27:9)
   at Anonymous function (eval code:114:13)
   at flush (eval code:26:9)",
      Symbol()_6.guptzs2u5wd: undefined,
      Symbol(react.element)_e.guptzs2u5wd: undefined
   }

Additional comments?

It's due to the new file : sentry-module/lib/sentry.mocked.js that contains new Proxy not supported by IE 11.

CodeSandbox not working in IE it's impossible to give you a reproduction link.

matthieusieben

matthieusieben posted a new bug report

sentry-module •

bug Unable to release when app in sub folder

Version

latest

Reproduction link

https://jsfiddle.net/

Steps to reproduce

Setup the following file structure:

- package.json
- node_modules
- src/
|  - my-app/
|  |  - nuxt.config.js
|  |  - pages/
|  |  | - index.vue

Configure nuxt.config.js

Run the following comman (from the root directory)

npm install --save nuxt
npx nuxt build src/my-app

What is expected ?

The build succeeds

What is actually happening?

error: .nuxt/dist/server: IO error for operation on .nuxt/dist/server: No such file or directory (os error 2)
Thooto

Thooto posted a new feature request

sentry-module •

idea Add $sentry to context

What problem does this feature solve?

Other nuxt plugins are accessible in the nuxt context with a $. This modules isn't.

What does the proposed changes look like?

The nuxt context object would have a $sentry attribute.

Would need to add in lib/module/sentry.(client|server).js:

inject('sentry', Sentry)
ctx.$sentry = Sentry // Currently missing

In some plugin:

export function (ctx) {
  ctx.$sentry // Now accessible
}
bayun2

bayun2 posted a new feature request

sentry-module •

idea Add cookies as an optional property

What problem does this feature solve?

sentry/node has support send cookies as an optional property,but sentry-module can't support pass config to requestHandler