Activities

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

lorado

lorado posted a new question

sentry-module •

Posting server source-maps to release

I am just starting using sentry with nuxt. I found, that in sentry-module source maps generation is enabled only for client. I am using universal mode, so some errors may occur also on server side, what should be the reported to sentry. But if I understend it right, it will not give me much information, as there sentry don't have any source maps from server side.
Shouldn't source map be also enabled for server code?
Funny fact - there is option to enable/disable including server code to release, but no option to enable generation of server source maps

ackushiw

ackushiw posted a new feature request

sentry-module •

idea Lazy loading of @sentry/browser

What problem does this feature solve?

This will reduce the app bundle size and improve initial loading speeds.

What does the proposed changes look like?

Following the guide here https://docs.sentry.io/platforms/javascript/#lazy-loading-sentry it should be possible, though it looks like the sentry loader is not available via npm :/

internalclass

internalclass posted a new question

sentry-module •

How to configure the ignoreurls property of sentry in nuxt?

sentry: {
config: {
ignoreUrls: [
/api.map.baidu.com/
]
}
}
my configuration is invalid. How can I configure it

jskim82

jskim82 posted a new feature request

sentry-module •

idea spa mode start error

What problem does this feature solve?

  1. Create a spa mode project
  2. npm run build
  3. npm run start
  4. The following error occurs in the browser

08b3c5e95115520b9175.js: 2 Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at n (08b3c5e95115520b9175.js: 2)
at h (08b3c5e95115520b9175.js: 2)
at 08b3c5e95115520b9175.js: 2
at Object. <anonymous> (08b3c5e95115520b9175.js: 2)
at f (f177cdf9be6b3e41f331.js: 1)
at Object. <anonymous> (08b3c5e95115520b9175.js: 2)
at f (f177cdf9be6b3e41f331.js: 1)
at Object. <anonymous> (08b3c5e95115520b9175.js: 2)
at f (f177cdf9be6b3e41f331.js: 1)

georgeboot

georgeboot posted a new bug report

sentry-module •

bug Attaching commits to release not working

Version

3.0.1

Reproduction link

https://jsfiddle.net

Steps to reproduce

  1. Make sure you are in an active git repo
  2. Install this package (yarn add @nuxtjs/sentry)
  3. In your nuxt.config.js, add the following:
export default {
    // ...

    modules: [
        // ...
        '@nuxtjs/sentry',
    ],

    sentry: {
        dsn: 'https://[email protected]/project-id',
        publishRelease: true
    },

    // ...
}
  1. run yarn build
  2. The script will create a release with Sentry using the current git commit hash, upload sourceMaps, set the release in the sentry client but not associate git commits to the release.

What is expected ?

It should also attach commits to the release (with the --auto flag)

What is actually happening?

It is not attaching any commits

Additional comments?

I have already looked at #65 but that didn't resolve my issue.

alexanderniebuhr

alexanderniebuhr posted a new bug report

sentry-module •

bug Not compatible with Nuxt's core-js

Version

v3.0.1

Reproduction link

https://jsfiddle.net

Steps to reproduce

Install latest nuxt release
Install latest nuxt-sentry release
Run npm run build

What is expected ?

Working building with Sentry Module

What is actually happening?

Get Error with "npm run build"
See in package-lock.json that synk "dependency of sentry" uses core-js 3, but nuxt only works with core-js 2

Additional comments?

Please provide any doc, or fixes. We really need sentry for our error tracking

mandaputtra

mandaputtra posted a new bug report

sentry-module •

bug Sentry Module failed install permission deined on centOS

Version

3.0.1

Reproduction link

https://jsfiddle.net/nofiddle

Steps to reproduce

Hi, I'm using CentOS here (VPS) on digital ocean, whenever I install this module with npm ci or npm i always failed, the message was permission denied.

Error: EACCES: permission denied, copyfile '/root/.npm/sentry-cli/e2bf76-sentry-cli-Linux-x86-64' -> '/var/www/project/html/project/node_modules/@sentry/cli/sentry-cli'

However I chmod al those folders but still, same permission denied. Any advice?

my chmod command :

$ chmod -R 777 /root/.npm/
$ chmod -R  777 /var/www/project/html/project/

What is expected ?

Project install without errors happens so sentry module could be used in nuxt

What is actually happening?

sentry module won't installed

Additional comments?

I'm using CentOS / Ubuntu too on development, but its install without a problem

rchl

rchl posted a new bug report

sentry-module •

bug Doesn't take router base into account when uploading releases

Version

v3.0.0

Reproduction link

http://nuxt.js

Steps to reproduce

router.base that is by default set to / and can be overridden, isn't taken into account in:

https://github.com/nuxt-community/sentry-module/blob/9092e9da2fecbb9e1dd5e6aad8194040062641e5/lib/module.js#L48

What is expected ?

webpackConfig.urlPrefix matches ~path.join(router.base, build.publicPath).

What is actually happening?

If base is overridden to, let's say /foo/ then client resources will be served from /foo/_nuxt/ but uploaded release artifacts on Sentry will have prefix ~/_nuxt/ so won't be matched against actual files.

lukaVarga

lukaVarga posted a new bug report

sentry-module •

bug this.$sentry is undefined in a local environment

Version

3.0.0

Reproduction link

https://codesandbox.io/embed/codesandbox-nuxt-m0vmy

Steps to reproduce

  • Add the '@nuxtjs/sentry' v 3.0.0 to the app
  • Add the package in nuxt config
  • Add sentry configuration in nuxt config
  • Do not add DSN (or let it be null)
  • Call one of the sentry methods, eg this.$sentry.setContext(params)

What is expected ?

Calling sentry methods should not trigger any errors, if DSN is empty (or if sentry is disabled for the environment), this.$sentry should not be undefined, it should, instead, implement mock methods that don't really do anything

What is actually happening?

Sentry object is available on window, but not within the components. Calling this.$sentry.foo, where foo is one of the sentry methods, results in an error (cannot call 'foo' of undefined)

Additional comments?

If @nuxtjs/sentry is added as a nuxt module, then this.$sentry should be available in the components regardless of the configuration as it's quite common to not define DSN for development / testing, or to use disabled: true in the module for the development / testing environment. In this case, this.$sentry should just be a mock object that just implements the methods but doesn't do anything with them.

sowinski

sowinski posted a new question

sentry-module •

Deactivate on development

How can I deactivate Sentry on development and keep it active on production?

BboyKeen

BboyKeen posted a new question

sentry-module •

Why is error logging linked to publishing a release ?

Hi,
I'm currently configuring the module to make it work with our deployment process and I'm facing an issue.
It looks like the module allow to upload sourcemaps only if a DSN has been provided.

However in a context of building an application before deploying it, we may want to upload a release just after the build.
Is there any reason two link these two different things ?

Thanks

mrleblanc101

mrleblanc101 posted a new question

sentry-module •

Shouldn't log local/dev error by default
jpbamberg1993

jpbamberg1993 posted a new question

sentry-module •

What type of Sentry project should I use?

When I'm creating this project in sentry should I select Vue.js, Node or JavaScript for project type? Nuxt is not an option.

vasisouv

vasisouv posted a new question

sentry-module •

this.$sentry undefined when no dsn is provided?

Github readme indicates that "If no dsn is provided, Sentry will be initialised, but errors will not be logged. See #47 for more information about this." I initialized my config like:

sentry: {
config: {}
},

and got the 'ℹ Errors will not be logged because no DSN has been provided' message.

However this.$sentry is undefined in the mounted() function of the page, Is that intended?

I use this type of config on local development to avoid error loggin, but my components break since I use some try{}catch(e){ this.$sentry.captureException(e)} or try{}catch(e){ this.$sentry.captureException(e) }