Skip to content

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

Open

Description

@slice

What React Native libraries do you use?

Expo Router, RN New Architecture, React Native Web, Expo Web

Are you using sentry.io or on-premise?

sentry.io (SaS)

Are you using any other error monitoring solution alongside Sentry?

No

Other Error Monitoring Solution Name

No response

@sentry/react-native SDK Version

8.28.0

How does your development environment look like?

  • pnpm 11.28.4
  • Node.js v26.8.1
  • Expo SDK 58.0.14
  • expo-router@58.0.23
  • react-native@0.88.0
  • metro@0.87.1

Sentry.init()

  initSentry({
    dsn: config.sentryDsn,

    // https://docs.sentry.io/platforms/react-native/data-management/data-collected/
    sendDefaultPii: true,

    // https://docs.sentry.io/platforms/react-native/configuration/options/#traces-sample-rate
    tracesSampleRate: 1.0,
    profilesSampleRate: 1.0,

    // https://docs.sentry.io/platforms/react-native/logs/
    enableLogs: true,

    replaysOnErrorSampleRate: 1.0,
    replaysSessionSampleRate: 0.1,

    integrations: [
      mobileReplayIntegration(),
      // https://docs.sentry.io/platforms/react-native/guides/expo/tracing/instrumentation/expo-router/
      expoRouterIntegration({
        enableTimeToInitialDisplay: true,
        enablePrefetchTracking: true,
      }),
      // NOTE(skip): if we don't pass this, the `sentry-trace` header that the
      // server receives won't actually match the trace ID on the client. dunno
      // why!
      reactNativeTracingIntegration({
        traceFetch: true,
        traceXHR: true,
      }),
      extraErrorDataIntegration({depth: 3, captureErrorCause: true}),
    ],
    enableNativeFramesTracking: true,

    _experiments: {
      // https://docs.sentry.io/platforms/react-native/guides/expo/tracing/instrumentation/automatic-instrumentation/#standalone-app-start-tracing
      enableStandaloneAppStartTracing: true,
    },
  });

Steps to Reproduce

  1. Create an Expo SDK 58 app. Integrate @sentry/react-native normally.
  2. Launch Expo app: expo start (Web/iOS/Android does not matter.)

Expected Result

(No extraneous output.)

Actual Result

 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to hierarchical resolution for backwards compatibility.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to file-based resolution.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to file-based resolution.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to hierarchical resolution for backwards compatibility.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to file-based resolution.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to file-based resolution.
 WARN  The package $REPO/node_modules/expo-router contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "$REPO/node_modules/expo-router/build/global-state/router-store" defined in "exports" is $REPO/node_modules/expo-router/build/global-state/router-store.js, however this file does not exist. Falling back to file-based resolution.

Activity

  1. linear-code commented on Oct 16, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 16, 2026
  3. slice commented on Oct 16, 2026

    @slice
    Author

    It looks like the expo-router integration attempts to require a private module:

    const mod = require('expo-router/build/global-state/router-store') as {

    However, this module was removed recently:

    expo/expo@b418a8a

    This leads to warnings from Metro, however it doesn't actually break Sentry. Error reporting, logging, etc. all work as intended, seemingly. Just wanted to flag.

  4. slice commented on Oct 16, 2026

    @slice
    Author

    I have not tested in depth, but I would presume that this breaks the expo-router integration and updating on Sentry's side is needed.

  5. dub578 commented on Oct 17, 2026

    @dub578

    Confirming on the same versions (8.28.0, expo-router 58.0.23). It’s more than the router-store path. Expo SDK 58 also removed the unsafe_action event (SDK 57 to 58 migration guide), which reactNavigationIntegration uses to start navigation spans. expo/expo#49408 moved navigation events to after the next render, so state and the action events all fire after the destination screen’s first fetch. So even with the store path fixed, no navigation span can start on SDK 58. I worked around it by starting an idle navigation span before calling router.push / replace.

  6. self-assigned this
    on Oct 19, 2026
  7. alwx commented on Oct 19, 2026

    @alwx
    Contributor

    Hello there, and thanks for reporting. We've seen your request and added it to our triage queue.
    We'll review it shortly and follow up if we need more information or once next steps are clearer.

  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions