Skip to content

fix(example): prevent duplicate Metro peer deps#16

Merged
markm39 merged 1 commit into
mainfrom
fix/example-metro-peer-deps
May 12, 2026
Merged

fix(example): prevent duplicate Metro peer deps#16
markm39 merged 1 commit into
mainfrom
fix/example-metro-peer-deps

Conversation

@markm39
Copy link
Copy Markdown
Contributor

@markm39 markm39 commented May 12, 2026

Summary

  • force the example Metro config to resolve React Native runtime peer dependencies from example/node_modules
  • block package-root peer dependency copies from the watched monorepo package root
  • keep @mathnotes/mobile-ink mapped to the local package source for example development

Why

Running the example from Xcode UI could load both example/node_modules and ../node_modules copies of React Native / gesture-handler / reanimated / worklets. That duplicated React Native dev environment setup and crashed with:

TypeError: property is not writable while defining global.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.

Verification

  • node -c example/metro.config.js
  • npm run typecheck
  • npm run test:example:typecheck
  • npm run test:example:export:ios
  • Generated a dev iOS bundle from npx expo start --dev-client --clear --port 8101 and confirmed it contains no package-root copies matching ../node_modules/(react-native|react-native-gesture-handler|react-native-reanimated|react-native-worklets)

Security / dependency note

  • Simplify review: no findings.
  • Security review: no findings in the changed config.
  • npm audit --omit=dev --audit-level=moderate still reports a pre-existing Expo/PostCSS advisory in the example dependency graph. The suggested automated fix is breaking and unrelated to this Metro resolver change, so this PR does not alter dependencies.

@markm39 markm39 merged commit 7a5bc48 into main May 12, 2026
1 check passed
@markm39 markm39 deleted the fix/example-metro-peer-deps branch May 12, 2026 15:09
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.

1 participant