Skip to content

fix(network-activity-plugin): avoid Metro optional dependency overlay for Nitro#273

Merged
V3RON merged 2 commits into
mainfrom
fix/network-activity-plugin-metro-optional-require
May 15, 2026
Merged

fix(network-activity-plugin): avoid Metro optional dependency overlay for Nitro#273
V3RON merged 2 commits into
mainfrom
fix/network-activity-plugin-metro-optional-require

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented May 15, 2026

Summary

Move react-native-nitro-fetch resolution to module initialization so the network activity plugin reads the optional dependency once before React Native finishes initializing.

Context

It's supposed to provide a workaround for Metro 0.82 bug, where optional dependencies required at run-time, after react-native is initialized, will show the error overlay. The changes done are moving the require time to before react-native is fully initialized, just like we do currently for react-native-sse, so the error overlay is never displayed.

This keeps the existing fallback behavior for apps that do not install react-native-nitro-fetch, but avoids re-running the optional require from the nitro inspector enable path.

Proposed Testing Scenario

  1. Run an app that includes @rozenite/network-activity-plugin without installing react-native-nitro-fetch.
  2. Start and stop network recording multiple times after the app has already initialized.
  3. Confirm the app does not show the Metro error overlay for the missing optional nitro dependency.
  4. Run an app that does install react-native-nitro-fetch and verify network recording still works for nitro-backed requests.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rozenite Skipped Skipped May 15, 2026 9:05am

Request Review

@V3RON V3RON changed the title fix(network-activity-plugin): avoid Metro optional dependency overlay for nitro fix(network-activity-plugin): avoid Metro optional dependency overlay for Nitro May 15, 2026
@V3RON V3RON merged commit 60a157e into main May 15, 2026
4 checks passed
@V3RON V3RON deleted the fix/network-activity-plugin-metro-optional-require branch May 15, 2026 11:24
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