Revert chokidar to ^4.0.3 in react-native-session-replay#1319
Open
jonathanmos wants to merge 1 commit into
Open
Revert chokidar to ^4.0.3 in react-native-session-replay#1319jonathanmos wants to merge 1 commit into
jonathanmos wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reverts the chokidar dependency used by @datadog/mobile-react-native-session-replay back to the 4.x line to avoid CommonJS require() failures caused by chokidar@5 being ESM-only, restoring compatibility for consumers on older Node/RN combinations.
Changes:
- Downgrade
chokidarinpackages/react-native-session-replayfrom^5.0.0to^4.0.3. - Update
yarn.lockto resolvechokidar@4.0.3(andreaddirp@^4.0.1) instead of the prior5.xchain.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/react-native-session-replay/package.json |
Reverts chokidar dependency to ^4.0.3 for CJS compatibility in the Metro plugin use case. |
yarn.lock |
Updates lock entries to resolve chokidar@4.0.3 (and compatible readdirp) and removes the chokidar@5 resolution for this range. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What does this PR do?
Reverts chokidar in @datadog/mobile-react-native-session-replay from ^5.0.0 back to ^4.0.3.
this change
Motivation
chokidar was bumped to ^5.0.0 as part of a broad, unrelated dependency-bump commit ("Update dependencies across packages"), replacing the ^4.0.3 pin the SVG asset-bundler Metro plugin was originally built and tested against.
chokidar 5.x is a pure ESM package with no CommonJS require export condition. The Metro plugin (withSessionReplayAssetBundler) is consumed via require() from a CommonJS entry point (metro.js → compiled metro/index.js), which throws ERR_REQUIRE_ESM the moment chokidar resolves to v5 — on any Node version below ~20.19 (the version where Node added synchronous require() support for ESM-only packages).
Since this SDK doesn't declare its own engines.node floor, and React Native itself didn't raise its own Node requirement to >=20.19.4 until RN 0.81 (Aug 2025), any consumer still on RN ≤0.80 building with Node 18/19 hits a crash the moment they wire up the plugin as documented in the README — before Metro even boots.
^4.0.3 is a dual CJS/ESM package (proper require export condition) with a Node >=14.16 floor, so it fixes this without requiring any Node or RN upgrade.
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)