Skip to content

fix(tracing): Support Expo Router 58 in expoRouterIntegration - #6923

Open
alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/6901
Open

alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/6901

Conversation

@alwx

@alwx alwx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix

📜 Description

expoRouterIntegration now gets the navigation container ref from the public useNavigationContainerRef export. It computes route info with getRouteInfoFromState, which Expo Router 57 and 58 both have at the same path. On Expo Router 58, the integration listens to the internal actionDispatched event and starts navigation spans through a new internal _startIdleNavigationSpan method on reactNavigationIntegration.

💡 Motivation and Context

Expo Router 58 removed expo-router/build/global-state/router-store and stopped sending __unsafe_action__. Metro then warned on every bundle, and the integration could not start navigation spans. Fixes #6901.

💚 How did you test it?

I ran expo export on samples/expo (expo-router 58.0.23). The warning appeared 10 times before this change and 0 times after it. I added unit tests for the new route info source, the action listener, and the listener cleanup.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking changes.

🔮 Next steps

On Expo Router 58, actionDispatched fires after the new screen renders, so spans start a bit late. A follow-up can use the expo-router:action-enqueued performance mark for an earlier start time.

alwx added a commit that referenced this pull request Oct 21, 2026
Replace the placeholder in the CHANGELOG entry with the PR number, #6923.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(tracing): Support Expo Router 58 in expoRouterIntegration by alwx in #6923
  • ci: Pin Java 17 for the Android dependency updater by antonis in #6928
  • feat(tracing): Connect React Native traces with embedded WebViews by antonis in #6794
  • refactor(ios): Use internal Cocoa serialization by philprime in #6917
  • chore(deps): update CLI to v3.8.1 by github-actions in #6924
  • chore(deps): update Cocoa SDK to v9.31.0 by github-actions in #6925
  • fix(tracing): Respect enableHTTPTimings and stop leaking HTTP timing listeners by antonis in #6912
  • fix(core): Stop wrapping RNSentry in TurboModuleContext by default by alwx in #6921
  • chore(deps): bump launch-editor from 2.14.1 to 2.14.2 by dependabot in #6922
  • ci: Fix Linux jobs on Ubuntu 26.04 runners by antonis in #6920
  • fix(core): Match Sentry package paths with Windows separators in Metro resolvers by alwx in #6915
  • chore(e2e): Update Expo sample to SDK 58 by antonis in #6914
  • chore(e2e): Bump E2E tests to React Native 0.88.0 by antonis in #6899
  • fix(ios): Find .xcode.env in the debug symbols phase under SwiftPM by alwx in #6911
  • chore(deps): update React Native to v0.88.0 by github-actions in #6903
  • chore(deps): bump getsentry/craft from 2.34.1 to 2.35.0 by dependabot in #6906
  • chore(deps): bump actions/create-github-app-token from 3.2.0 to 3.3.0 by dependabot in #6908
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.33.1 to 2.35.0 by dependabot in #6907
  • chore(sample): Bump React Native sample to 0.88.0 by antonis in #6910
  • chore(deps): bump actions/setup-java from 6.0.1 to 6.1.0 by dependabot in #6909
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6905
  • chore(deps): update Sentry Android Gradle Plugin to v6.24.0 by github-actions in #6902
  • chore(deps): bump @appium/support from 7.0.6 to 7.2.8 by dependabot in #6897
  • ci(e2e): Remove app metrics job and performance-tests by antonis in #6896

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against fc6a0b5

alwx added 2 commits October 22, 2026 11:03
Expo Router 58 removed the internal router-store module and no longer emits
React Navigation's __unsafe_action__ event. Because 58 declares package
exports, Metro printed an invalid package.json warning for the router-store
require on every bundle, and the integration could not start navigation spans.

The navigation container ref now comes from the public
useNavigationContainerRef export, which returns a module-level ref in
Expo Router 57 and 58. Route info is computed from the root navigation state
with getRouteInfoFromState, which both versions ship at the same path.

On Expo Router 58 the integration listens to the internal actionDispatched
event and starts the idle navigation span through a new internal
_startIdleNavigationSpan method on reactNavigationIntegration. Expo Router 57
has no exports field, so the missing internalNavigationEvents path is a silent
optional dependency there and spans still start from __unsafe_action__.

Fixes #6901
Replace the placeholder in the CHANGELOG entry with the PR number, #6923.
@alwx
alwx marked this pull request as ready for review October 22, 2026 09:04
@alwx
alwx force-pushed the alwx/bugfix/6901 branch from 87f19fa to c899efa Compare October 22, 2026 09:04
@alwx
alwx force-pushed the alwx/bugfix/6901 branch from 87f19fa to c899efa Compare October 22, 2026 09:04
@alwx
alwx requested a review from a team as a code owner October 22, 2026 09:04

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread packages/core/src/js/tracing/expoRouterStore.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fc6a0b5. Configure here.

stack: undefined,
},
});
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Late navigation spans get discarded

High Severity

actionDispatched on Expo Router 58 fires after the new screen renders, but _startIdleNavigationSpan still waits for a later state event to attach route info. That event has typically already been delivered, so the idle span hits routeChangeTimeoutMs and is discarded instead of being sent.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit fc6a0b5. Configure here.

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.

expo-router integration requires expo-router/build/global-state/router-store, but it was removed in SDK 58

1 participant