---
title: "Legacy Uploading Methods"
description: "Learn about how to upload source maps with older SDKs and Sentry tools."
url: https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods/
---

# Legacy Uploading Methods | Sentry for React Native

This page describes how to upload source maps for older React Native SDKs. If you're using the latest version of the SDK, [follow these instructions](https://docs.sentry.io/platforms/react-native/sourcemaps.md).

## [Legacy Instructions for Preparing Source Maps for a Release](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#legacy-instructions-for-preparing-source-maps-for-a-release)

You need to generate and upload the source maps at build time for **every release** of your app for the events sent to be correctly unminified. To do so, follow these steps:

### [1. Configure CLI](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#1-configure-cli)

Configure the CLI by reviewing the [configuration guide](https://docs.sentry.io/cli/configuration.md) for CLI commands.

### [2. Generate the bundle and source maps](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#2-generate-the-bundle-and-source-maps)

##### Hermes

If you use the **Hermes engine**, you will need to [follow this guide to compile source maps for Hermes](https://docs.sentry.io/platforms/react-native/manual-setup/hermes.md#custom-source-maps).

You can use the React Native CLI to generate the JavaScript bundle and source maps for your app:

```bash
react-native bundle \
  --dev false \
  --platform android \
  --entry-file index.android.js \
  --reset-cache \
  --bundle-output index.android.bundle \
  --sourcemap-output index.android.bundle.map
```

[Learn more about the React Native CLI bundle command](https://github.com/react-native-community/cli/blob/master/docs/commands.md#bundle).

#### [2.1 Pass your entry file](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#21-pass-your-entry-file)

Pass your entry file to `--entry-file` for Android or iOS, respectively. By default, this file is usually named `index.js`. It is often named `index.android.js` for Android or `index.ios.js` for iOS.

#### [2.2 Output your bundle files and source maps](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#22-output-your-bundle-files-and-source-maps)

These files will output your bundle and source maps. By default, these files are named `index.android.bundle` and `index.android.bundle.map` for Android and `main.jsbundle` and `main.jsbundle.map` for iOS.

The source map's name must be the bundle's name appended with `.map` for source maps to correctly be detected.

### [3. Upload the bundle and source maps](https://docs.sentry.io/platforms/react-native/sourcemaps/troubleshooting/legacy-uploading-methods.md#3-upload-the-bundle-and-source-maps)

```bash
node_modules/@sentry/cli/bin/sentry-cli sourcemaps upload \
    --release <release> \
    --dist <dist> \
    --strip-prefix /path/to/project/root \
    index.android.bundle index.android.bundle.map
```
