If you are using Nuxt2 see here
It should work out of the box no changes needed. Only thing missing is support for uploading source maps on the webpack build.
- Add
nuxt-bugsnagdependency to your project
npm install nuxt-bugsnag- Add
nuxt-bugsnagto themodulessection ofnuxt.config.js.
{
modules: [
'nuxt-bugsnag'
]
}You can pass every bugsnag options in the config object
{
bugsnag: {
config: {
apiKey: 'your key',
enabledReleaseStages: ['staging', 'production'],
}
}
}You can upload sourcemaps by adding the option publishRelease.
It's important to set the baseUrl as well, it will allow bugsnag to map your errors to the sourcemap:
{
bugsnag: {
publishRelease: true,
baseUrl: 'http://localhost:3000'
}
}I would recommend to set these options
{
modules: [
'nuxt-bugsnag',
],
bugsnag: {
publishRelease: true,
config: {
apiKey: 'YOUR_API_KEY',
enabledReleaseStages: ['staging', 'production'],
releaseStage: process.env.NODE_ENV
appVersion: 'YOUR_VERSION',
}
}
}The simplest answer is like this.
this.$bugsnag.notify(new Error('Some Error'))
if you like the composition approach you can do it like this
useBugsnag().notify('Some Error')
- Clone this repository
- Install dependencies using
npm install - Start development server using
npm run dev
Copyright (c) Julian Martin julian.martin@russmedia.com