Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,12 @@ export default defineConfig(config => ({

### Build Configuration

Add the `buildEnd` hook to your `react-router.config.ts`:
Since the `buildEnd` hook will not be executed for Hydrogen, you'll need to manually upload source maps using the [Sentry CLI](/cli/) instead.

```ts {filename:react-router.config.ts}
import type {Config} from '@react-router/dev/config';
import { sentryOnBuildEnd } from '@sentry/react-router';

export default {
appDirectory: 'app',
buildDirectory: 'dist',
ssr: true,
buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
// Call this at the end of the hook
(await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest }));
}
} satisfies Config;
```bash
# Inject debug IDs
sentry-cli sourcemaps inject /path/to/build/dir
# Upload sourcemaps
sentry-cli sourcemaps upload /path/to/build/dir
Comment on lines +191 to +193
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: Incorrect documentation for source map path leads to silent upload failure
  • Description: The documentation for Hydrogen with React Router provides an incorrect and generic placeholder path (/path/to/build/dir) for the sentry-cli sourcemaps inject command. The correct path for Hydrogen projects is the dist directory. Using the incorrect path will cause the CLI command to fail silently, leading to source maps not being uploaded and resulting in un-symbolicated stack traces for production errors.

  • Suggested fix: Update the documentation to use the correct, specific build directory for Hydrogen, which is dist. For example: sentry-cli sourcemaps inject ./dist.
    severity: 0.7, confidence: 0.9

Did we get this right? 👍 / 👎 to inform future reviews.

```

Loading