Skip to content

docs(sentry): document false-positive warnings and add troubleshooting guide#935

Open
vdimarco wants to merge 1 commit intomasterfrom
terragon/fix-frontend-errors-gmxcrt
Open

docs(sentry): document false-positive warnings and add troubleshooting guide#935
vdimarco wants to merge 1 commit intomasterfrom
terragon/fix-frontend-errors-gmxcrt

Conversation

@vdimarco
Copy link
Contributor

@vdimarco vdimarco commented Jan 29, 2026

Summary

  • Document Sentry configuration warnings that appear in development logs
  • Add comprehensive troubleshooting guide explaining each warning
  • Update .env.example with detailed explanation of warning suppressions

Changes

  • SENTRY_WARNINGS.md: New troubleshooting guide explaining all Sentry warnings
    • Documents "onRequestError hook not found" warning (false positive)
    • Documents "No global-error.js file" warning (false positive)
    • Documents "Rename sentry.client.config.ts" deprecation warning (false positive)
    • Provides verification steps and production impact assessment
  • .env.example: Enhanced documentation for SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING
    • Added detailed explanation of when and why to use suppression
    • Documented that warnings are false positives from Sentry's detection logic

Background

Development logs show three Sentry warnings that are actually false positives:

1. "onRequestError hook not found"

[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file.

Status: ❌ False Positive
Reality: Hook IS properly configured in instrumentation.ts:17:

export const onRequestError = Sentry.captureRequestError;

2. "No global-error.js file"

[@sentry/nextjs] It seems like you don't have a global error handler set up.

Status: ❌ False Positive
Reality: global-error.tsx EXISTS at src/app/global-error.tsx
Cause: Sentry's check looks for .js but doesn't recognize .tsx files

3. "Rename sentry.client.config.ts"

[@sentry/nextjs] DEPRECATION WARNING: It is recommended renaming your `sentry.client.config.ts` file

Status: ❌ False Positive
Reality: Already using instrumentation-client.ts (the recommended approach)

Rationale

These warnings cause confusion for developers but don't affect functionality. All Sentry features are working correctly:

  • ✅ Request errors are being captured via onRequestError hook
  • ✅ Global error boundary is functional and reporting to Sentry
  • ✅ Client-side instrumentation is properly configured
  • ✅ Production error monitoring is operational

This PR provides clear documentation to:

  1. Explain why each warning appears
  2. Confirm all features are properly implemented
  3. Reduce developer confusion
  4. Provide verification steps

Test Plan

  • Reviewed instrumentation.ts to confirm onRequestError hook exists (line 17)
  • Verified global-error.tsx exists and has Sentry integration
  • Confirmed instrumentation-client.ts is being used (not deprecated config)
  • Checked .env.example documentation is clear and accurate
  • Verified SENTRY_WARNINGS.md covers all three warnings comprehensively

Impact

  • ✅ Reduces developer confusion about Sentry warnings
  • ✅ Provides clear reference documentation for troubleshooting
  • ✅ No code changes - documentation only
  • ✅ No impact on runtime behavior or error tracking
  • ✅ No breaking changes

Related

  • Addresses Sentry warnings observed in Railway logs and local development
  • Complements existing Sentry configuration in instrumentation files
  • Supports developer experience improvements

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Summary by CodeRabbit

  • Documentation
    • Expanded Sentry-related environment configuration documentation with comprehensive explanations of development warnings, suppression methods, and updated guidance notes
    • Added new documentation file detailing false-positive Sentry warnings in development logs, step-by-step suppression instructions using environment variables, verification procedures to confirm correct suppression, and explicit confirmation that production behavior remains completely unaffected by these changes

✏️ Tip: You can customize this high-level summary in your review settings.

Greptile Overview

Greptile Summary

This PR adds comprehensive documentation for three Sentry warnings that appear during development but are false positives. The warnings occur due to detection limitations in @sentry/nextjs - specifically timing issues with onRequestError hook detection, file extension mismatches for global-error.tsx, and overly broad deprecation warnings.

Key improvements:

  • Added SENTRY_WARNINGS.md providing detailed explanations of each warning, why they appear, and verification steps
  • Enhanced .env.example with clear multi-line documentation explaining both warning types
  • All claims verified: onRequestError hook exists at instrumentation.ts:17, global-error.tsx is properly implemented with Sentry integration, and instrumentation-client.ts is correctly used instead of deprecated config

Impact:
This documentation-only change reduces developer confusion without affecting runtime behavior or error tracking functionality.

Confidence Score: 5/5

  • This PR is completely safe to merge - documentation-only with no code changes
  • Perfect score because this is purely documentation with no runtime changes. All technical claims were verified against the actual codebase (instrumentation.ts, global-error.tsx, instrumentation-client.ts). The documentation is clear, accurate, and helpful for developers.
  • No files require special attention - both changes are straightforward documentation improvements

Important Files Changed

Filename Overview
.env.example Enhanced documentation for Sentry warning suppression - clear explanations added for false-positive warnings
SENTRY_WARNINGS.md New comprehensive troubleshooting guide documenting all three Sentry false-positive warnings with clear explanations and verification steps

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Build as Build Process
    participant Sentry as @sentry/nextjs
    participant Files as Codebase Files
    participant Logs as Dev Logs

    Dev->>Build: Run development server
    Build->>Sentry: Initialize Sentry SDK
    
    Note over Sentry,Files: Warning 1: onRequestError Hook
    Sentry->>Files: Check for onRequestError hook
    Note right of Sentry: Check happens during startup<br/>before instrumentation.ts loads
    Sentry->>Logs: ⚠️ "onRequestError hook not found"
    Note over Files: Actually exists at<br/>instrumentation.ts:17
    
    Note over Sentry,Files: Warning 2: Global Error File
    Sentry->>Files: Look for global-error.js
    Files-->>Sentry: File not found (.js)
    Note right of Files: global-error.tsx exists<br/>but Sentry only checks .js
    Sentry->>Logs: ⚠️ "No global-error.js file"
    
    Note over Sentry,Files: Warning 3: Config Deprecation
    Sentry->>Files: Check for deprecated config
    Files-->>Sentry: sentry.client.config.ts not found
    Note right of Files: Already using<br/>instrumentation-client.ts
    Sentry->>Logs: ⚠️ "Rename sentry.client.config.ts"
    Note over Sentry: Shown globally even if<br/>not using old approach
    
    Dev->>Logs: View warnings
    Dev->>Files: Read SENTRY_WARNINGS.md
    Note over Dev: Understands warnings<br/>are false positives
    
    Note over Dev,Files: Runtime Behavior
    Files->>Sentry: Errors captured correctly
    Sentry->>Sentry: All features working ✓
Loading

…g guide

## Summary
- Document Sentry configuration warnings that appear in development logs
- Add comprehensive troubleshooting guide explaining each warning
- Update .env.example with detailed explanation of warning suppressions

## Changes
- **SENTRY_WARNINGS.md**: New troubleshooting guide explaining all Sentry warnings
- **.env.example**: Enhanced documentation for SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING

## Rationale
Development logs show three Sentry warnings that are actually false positives:
1. "onRequestError hook not found" - Hook IS properly configured in instrumentation.ts:17
2. "No global-error.js file" - global-error.tsx EXISTS at src/app/global-error.tsx
3. "Rename sentry.client.config.ts" - Already using instrumentation-client.ts

These warnings cause confusion but don't affect functionality. This PR provides clear
documentation to explain why they occur and confirms all Sentry features work correctly.

## Impact
- ✅ Reduces developer confusion about Sentry warnings
- ✅ Provides clear reference documentation
- ✅ No code changes - documentation only
- ✅ No impact on runtime behavior or error tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
gatewayz-frontend Error Error Jan 29, 2026 2:14pm

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Updates Sentry warning documentation in .env.example with expanded commentary and adds SENTRY_WARNINGS.md file containing detailed guidance on false-positive warnings encountered during development, including verification steps and suppression configurations via environment variables.

Changes

Cohort / File(s) Summary
Sentry Documentation Updates
.env.example
Expanded Sentry-related warning comments, replacing brief note with detailed explanation of Global Error Handler Warning and Instrumentation Hook Warning with rationale for suppression via environment variable.
Sentry Warnings Guide
SENTRY_WARNINGS.md
New comprehensive documentation file detailing false-positive Sentry warnings (three specific warnings covered), their explanations, verification steps, suppression methods, production impact assessment, summary table, and related configuration files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through warnings, false and true,
With Sentry's notes in vibrant hue,
Documentation blooms, so clear and bright,
Developers rest through dev-time night! ✨📝

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding documentation about false-positive Sentry warnings and a troubleshooting guide, which aligns with the additions of SENTRY_WARNINGS.md and updates to .env.example.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch terragon/fix-frontend-errors-gmxcrt

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@SENTRY_WARNINGS.md`:
- Around line 10-14: Add language identifiers to the fenced code blocks
containing Sentry warnings (e.g., the blocks starting with "[`@sentry/nextjs`]
Could not find `onRequestError` hook", "[`@sentry/nextjs`] It seems like you don't
have a global error handler set up.", and "[`@sentry/nextjs`] DEPRECATION WARNING:
It is recommended renaming your `sentry.client.config.ts` file") by changing
their opening fences to include a language tag such as "text" (for example, use
```text) so markdownlint stops flagging missing language tags; apply the same
change to the other reported blocks (lines with the same three warning strings
referenced in the comment).
- Around line 150-154: The markdown table in SENTRY_WARNINGS.md violates MD060
because the pipes lack surrounding spaces; update the header row "Warning |
Status | Action Required" and each data row containing "`onRequestError` hook
not found", "No `global-error.js` file", and "Rename `sentry.client.config.ts`"
so that every pipe character has a single space on both sides (e.g., " | ")
throughout the table to satisfy markdownlint MD060.

Comment on lines +10 to +14
```
[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file.
This indicates outdated configuration of the Sentry SDK.
Use `Sentry.captureRequestError` to instrument the `onRequestError` hook.
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language identifiers to fenced code blocks.

Markdownlint flags these blocks for missing language tags; add appropriate identifiers (e.g., text) to keep lint clean.

🔧 Suggested fix
-```
+```text
 [`@sentry/nextjs`] Could not find `onRequestError` hook in instrumentation file.
 This indicates outdated configuration of the Sentry SDK.
 Use `Sentry.captureRequestError` to instrument the `onRequestError` hook.

```diff
-```
+```text
 [`@sentry/nextjs`] It seems like you don't have a global error handler set up.
 It is recommended that you add a 'global-error.js' file with Sentry instrumentation.
 (you can suppress this warning by setting SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING=1)

```diff
-```
+```text
 [`@sentry/nextjs`] DEPRECATION WARNING: It is recommended renaming your `sentry.client.config.ts` file,
 or moving its content to `instrumentation-client.ts`.
 When using Turbopack `sentry.client.config.ts` will no longer work.
</details>


Also applies to: 42-46, 82-86

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.20.0)</summary>

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @SENTRY_WARNINGS.md around lines 10 - 14, Add language identifiers to the
fenced code blocks containing Sentry warnings (e.g., the blocks starting with
"[@sentry/nextjs] Could not find onRequestError hook", "[@sentry/nextjs] It
seems like you don't have a global error handler set up.", and "[@sentry/nextjs]
DEPRECATION WARNING: It is recommended renaming your sentry.client.config.ts
file") by changing their opening fences to include a language tag such as "text"
(for example, use ```text) so markdownlint stops flagging missing language tags;
apply the same change to the other reported blocks (lines with the same three
warning strings referenced in the comment).


</details>

<!-- fingerprinting:phantom:triton:eagle -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +150 to +154
| Warning | Status | Action Required |
|---------|--------|-----------------|
| `onRequestError` hook not found | ❌ False Positive | ✅ Already implemented in `instrumentation.ts:17` |
| No `global-error.js` file | ❌ False Positive | ✅ Implemented as `global-error.tsx` |
| Rename `sentry.client.config.ts` | ❌ False Positive | ✅ Already using `instrumentation-client.ts` |
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix table pipe spacing for markdownlint MD060.

The summary table needs spaces around pipes to satisfy the configured style.

🔧 Suggested fix
-| Warning | Status | Action Required |
-|---------|--------|-----------------|
-| `onRequestError` hook not found | ❌ False Positive | ✅ Already implemented in `instrumentation.ts:17` |
-| No `global-error.js` file | ❌ False Positive | ✅ Implemented as `global-error.tsx` |
-| Rename `sentry.client.config.ts` | ❌ False Positive | ✅ Already using `instrumentation-client.ts` |
+| Warning | Status | Action Required |
+| --- | --- | --- |
+| `onRequestError` hook not found | ❌ False Positive | ✅ Already implemented in `instrumentation.ts:17` |
+| No `global-error.js` file | ❌ False Positive | ✅ Implemented as `global-error.tsx` |
+| Rename `sentry.client.config.ts` | ❌ False Positive | ✅ Already using `instrumentation-client.ts` |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Warning | Status | Action Required |
|---------|--------|-----------------|
| `onRequestError` hook not found | ❌ False Positive | ✅ Already implemented in `instrumentation.ts:17` |
| No `global-error.js` file | ❌ False Positive | ✅ Implemented as `global-error.tsx` |
| Rename `sentry.client.config.ts` | ❌ False Positive | ✅ Already using `instrumentation-client.ts` |
| Warning | Status | Action Required |
| --- | --- | --- |
| `onRequestError` hook not found | ❌ False Positive | ✅ Already implemented in `instrumentation.ts:17` |
| No `global-error.js` file | ❌ False Positive | ✅ Implemented as `global-error.tsx` |
| Rename `sentry.client.config.ts` | ❌ False Positive | ✅ Already using `instrumentation-client.ts` |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

151-151: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


151-151: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


151-151: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


151-151: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


151-151: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


151-151: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)

🤖 Prompt for AI Agents
In `@SENTRY_WARNINGS.md` around lines 150 - 154, The markdown table in
SENTRY_WARNINGS.md violates MD060 because the pipes lack surrounding spaces;
update the header row "Warning | Status | Action Required" and each data row
containing "`onRequestError` hook not found", "No `global-error.js` file", and
"Rename `sentry.client.config.ts`" so that every pipe character has a single
space on both sides (e.g., " | ") throughout the table to satisfy markdownlint
MD060.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +21 to +23
**Location**: `instrumentation.ts:17`
```typescript
export const onRequestError = Sentry.captureRequestError;
Copy link
Contributor

Choose a reason for hiding this comment

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

line reference mentions instrumentation.ts:17, but consider removing specific line numbers from documentation as they can become outdated if the file changes. "exports onRequestError correctly" would be more maintainable

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: SENTRY_WARNINGS.md
Line: 21:23

Comment:
line reference mentions `instrumentation.ts:17`, but consider removing specific line numbers from documentation as they can become outdated if the file changes. "exports `onRequestError` correctly" would be more maintainable

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@openhands-ai
Copy link

openhands-ai bot commented Jan 29, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • CI

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #935 at branch `terragon/fix-frontend-errors-gmxcrt`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant