Skip to content

Sentry Wizard Installation

Nagarjun Sanji edited this page Sep 25, 2024 · 1 revision

Overview

This guide will walk you through installing and configuring Sentry to track errors and automatically upload source maps for better debugging. We'll use Sentry's wizard tool to set up source maps in your project.

Prerequisites

Node.js and npm: Make sure you have Node.js and npm installed. You can verify by running the following commands:

node -v
npm -v

If you don’t have them installed, download them from nodejs.org.

Sentry Account: Ensure that you have an account on Sentry and have created a project for your application.

Installation Process

  1. Install Sentry Wizard Sentry provides a wizard tool to help you integrate Sentry and configure source maps. Run the following command in your project directory:
npx @sentry/wizard@latest -i sourcemaps

This command will guide you through a few steps to configure Sentry for source map uploads in your project.

  1. Select Your Platform Once you run the command, you'll be prompted to select the platform for which you are setting up Sentry. Choose the appropriate option based on your project's language or framework.

For example, if you're working on a JavaScript project (like React, Angular, or Node.js), choose javascript.

  1. Configure Sentry in Your Project After selecting your platform, the wizard will:

Install the necessary Sentry packages for your platform. Create or modify your configuration files (e.g., sentry.properties, .sentryclirc). Update your build scripts to upload source maps to Sentry during production builds. You can also configure the SENTRY_DSN and other Sentry settings manually in your configuration file.

  1. Build and Upload Source Maps After configuration, ensure that your build process is set to upload source maps to Sentry. For most setups, the wizard will automatically modify your build configuration. If you're using a JavaScript bundler like Webpack, it will automatically append the Sentry plugin to handle source maps.
Example Webpack configuration:

js
Copy code
const SentryWebpackPlugin = require('@sentry/webpack-plugin');

module.exports = {
  // Your existing Webpack config
  plugins: [
    new SentryWebpackPlugin({
      include: './dist',
      ignore: ['node_modules', 'webpack.config.js'],
    }),
  ],
};
  1. Verify Your Configuration Once everything is set up, verify that source maps are being uploaded to Sentry by building your project:
npm run build

Check your Sentry project dashboard to confirm that source maps have been uploaded.

Troubleshooting If you encounter any issues during the installation process or the source maps aren't working as expected, please refer to the following resources:

Sentry Docs: Uploading Source Maps Sentry Wizard GitHub Feel free to open a GitHub issue if you need additional help!

Navigation

Resources

Acknowledgments


© 2024 debricked. All rights reserved.

Clone this wiki locally