Skip to content

fix(sample-apps): resolve nested workspace deps in RN metro configs - #2443

Merged
santhoshvai merged 1 commit into
mainfrom
ci-fix
Sep 14, 2026
Merged

santhoshvai merged 1 commit into
mainfrom
ci-fix

Conversation

@santhoshvai

@santhoshvai santhoshvai commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

💡 Overview

CI failed for RN sample apps as Metro only searched the app and repo root node_modules, and yarn nests some deps in neither — so the bundle failed.

Happened since #2436 on @stream-io/state-store. The Expo apps have been broken longer on react-native-url-polyfill.

📝 Implementation notes

Added packages/react-native-sdk/node_modules as a third Metro search path in all three sample apps. Searched last, so react and react-native still come from the app's own folder and stay single-copy.

🎫 Ticket: https://linear.app/stream/issue/XYZ-123

📑 Docs: https://github.com/GetStream/docs-content/pull/

Summary by CodeRabbit

  • Bug Fixes
    • Improved dependency resolution for React Native sample apps when bundling the SDK from source.
    • Prevented duplicate React and React Native instances during Metro builds.

The RN sample apps restrict Metro to the app and root `node_modules` and
keep `disableHierarchicalLookup` on, but bundle the workspace SDK from
source. Dependencies yarn could not hoist to the root -- `@stream-io/i18n`'s
`@stream-io/state-store`, `react-native-url-polyfill` -- were therefore
unresolvable, breaking the dogfood release bundle since #2436 and the two
Expo apps for longer.

Add `packages/react-native-sdk/node_modules` as a last search path so those
resolve while `react` and `react-native` keep coming from the app's own
`node_modules` and stay single-copy.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ae79b42e-74da-4ace-9667-9c84bc7d6b20

📥 Commits

Reviewing files that changed from the base of the PR and between 57f23a1 and 5b0205c.

📒 Files selected for processing (3)
  • sample-apps/react-native/dogfood/metro.config.js
  • sample-apps/react-native/expo-video-sample/metro.config.js
  • sample-apps/react-native/ringing-tutorial/metro.config.js

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Three React Native sample Metro configurations now append the SDK’s unhoisted node_modules directory to nodeModulesPaths.

Changes

React Native Metro configuration

Layer / File(s) Summary
Add SDK dependency paths
sample-apps/react-native/*/metro.config.js
The dogfood, Expo video, and ringing tutorial configurations append packages/react-native-sdk/node_modules as the final Metro resolver path. Comments document dependency resolution and single-copy React behavior where present.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5b020

This configuration-only change adds the SDK dependency search path while preserving existing resolution order; no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix and the affected React Native Metro configurations.
Description check ✅ Passed The description includes the required Overview and Implementation notes sections. It explains the CI failure, the affected dependencies, and the Metro path change. The ticket and documentation links u…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@santhoshvai
santhoshvai merged commit 1c019c4 into main Sep 14, 2026
9 checks passed
@santhoshvai
santhoshvai deleted the ci-fix branch September 14, 2026 13:01
@github-actions

Copy link
Copy Markdown

Bundle size

Built package output. Sizes in KB; delta vs main@57f23a1.

No significant package size increase vs main.

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.

2 participants