Skip to content

View events not tracked due to CJS/ESM dual singleton issue (Expo SDK 54 / Metro 0.83.3) #77

Description

@jpmonette-euc

Describe what happened

After upgrading to Expo SDK 54, view events are no longer being sent to Datadog. Action events still work correctly.

Steps to reproduce

  1. Upgrade to Expo SDK 54.0.0 with the following packages:
"@datadog/mobile-react-native": "^2.13.2"
"@datadog/mobile-react-navigation": "^2.13.2"
"expo-datadog": "^54.0.0"
  1. Use expo-datadog for the DatadogProvider, as described in docs
  2. Set up automated navigation tracking with DdRumReactNavigationTracking from @datadog/mobile-react-navigation

Expected behavior

View events should be tracked and sent to Datadog alongside action events.

Actual behavior

Only action events are sent, sent via DdRum exposed by expo-datadog. View events are missing.

Root cause analysis

The BoundedBuffer singleton (sdk/DatadogProvider/Buffer/BoundedBuffer.js) appears to be instantiated twice - once via CommonJS and once via ESM. This causes the SDK state to split between two instances.

Timeline:

It looks like expo-datadog may still be forcing CommonJS imports, while @datadog/mobile-react-navigation loads via ESM — resulting in two separate singleton instances.

Environment

  • Expo SDK: 54.0.0
  • expo-datadog: 54.0.0
  • @datadog/mobile-react-native: 2.13.2
  • @datadog/mobile-react-navigation: 2.13.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions