Make error tracking in your next Gridsome project easier than ever.
npm install gridsome-plugin-sentry --save
yarn add gridsome-plugin-sentry
Add the following to the gridsome.config.js to initalize Sentry error tracking
module.exports = {
plugins: [
{
use: 'gridsome-plugin-sentry',
options: {
dsn: 'replace with your Sentry DSN URL',
attachProps: true, // defaults to true
logErrors: process.env.NODE_ENV === 'development' // defaults to false, see below for further info
}
}
]
}
- For a quick and easy test, add the following to any component that is included in your index page
mounted () {
throw 'testing Sentry connection';
}
- Run
npm run develop
from the root directory - Navigate to your Sentry dashboard and confirm the error was captured
New to Sentry? Check out sentry.io
By default Sentry will not call the internal logError function of Vue and will not be seen in the developers console. You can enable logging errors in the browsers development console with any statement that evaluates to a boolean. See Vue integration docs for more info
If you want Sentry to ignore events from localhost
or any specific IP address you can do so from your Sentry dashboard with inbound filters.
From you dashboard, Settings -> Projects -> 'Project Name' -> Inbound Filters
Configuration options and examples, docs.sentry.io