fix: configure Metro for monorepo local development in expo-example#387
Merged
Rosie-Kennelly-1 merged 3 commits intomainfrom Mar 10, 2026
Merged
Conversation
Without watchFolders, nodeModulesPaths, and blockList, Metro cannot resolve the symlinked @intercom/intercom-react-native package when developing locally from examples/expo-example. This caused a cascade of errors: unresolved modules, duplicate React Native copies, and SyntaxError from stale dependencies in the library root's node_modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
imSzukala
approved these changes
Mar 10, 2026
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.
Why?
Running the expo-example locally for development currently fails with a cascade of Metro errors — unresolved modules, duplicate React Native copies, and SyntaxErrors from stale dependencies in the library root's
node_modules. This makes it tedious to set up and test changes to the library.How?
Adds the standard monorepo Metro configuration (
watchFolders,nodeModulesPaths,blockList) so Metro can resolve the symlinked@intercom/intercom-react-nativepackage while keeping dependency resolution scoped to the example's ownnode_modules.watchFolders = [libraryRoot]— tells Metro "the library source lives two directories up, watch it for changes." Without this, Metro can't find @intercom/intercom-react-native at all → "Unable to resolve module" error.nodeModulesPaths = [path.resolve(__dirname, 'node_modules')]— tells Metro "resolve all dependencies from the example's node_modules only." Without this, Metro also picks up node_modules from the library root, which has a different (older) version of react-native → duplicate React Native copies and SyntaxError on VirtualView.js.blockList = [...]— explicitly blocks the library root's node_modules from Metro's module resolution. Belt-and-suspenders with IOS SDK Bridge #2 to prevent any transitive resolution from leaking through.Generated with Claude Code