test(tanstackstart-react): Move initialization to client entry point#21161
Merged
nicohrubec merged 4 commits intoMay 26, 2026
Conversation
s1gr1d
approved these changes
May 26, 2026
Member
s1gr1d
left a comment
There was a problem hiding this comment.
Look good! It's probably worth to add something about that to the changelog.
Reproduces #21088: errors thrown in the client entry before hydration are silently lost because Sentry.init() runs inside getRouter() which is called during hydration. The test also verifies that early console breadcrumbs are attached to the error report. These tests are expected to fail with the current setup and pass once Sentry.init() is moved to the client entry point. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moves client-side Sentry.init() from getRouter() to client.tsx so it runs before hydration. The browser tracing integration is added later via addIntegration() once the router is available. This ensures errors and breadcrumbs from code that runs before hydration (e.g. third-party library inits) are captured. Fixes #21088 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8d712af to
13d0a45
Compare
13d0a45 to
e1f999b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e1f999b. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Moves
Sentry.init()fromgetRouter()to the client entry point so it runs before hydration in our e2e test applications. Previously, any errors or breadcrumbs from before hydration (e.g. third-party library inits) were silently lost becauseSentry.init()only ran during hydration insidegetRouter().This should be the recommended setup for users, will update the docs accordingly.
Fixes #21088