Skip to content

Conversation

@akuul
Copy link
Contributor

@akuul akuul commented Jun 16, 2025

Please verify the following:

  • yarn build-and-test:local passes

Describe your PR

With the release of React Native 0.80, XHRInterceptor path got changed, again.

This is an extension of RN 0.79 support PR #1556

Deep import will be removed at 0.82 or later so unclear what happens then :(

Test Plan

Install reactotron-react-native in a "react-native": "^0.80.0".

@joshuayoes
Copy link
Contributor

joshuayoes commented Jun 23, 2025

I tested this PR with a [email protected] app by doing:

  1. npx @react-native-community/cli@latest init ReactNative80
  2. Install reactotron-react-native using Quick Start docs.
  3. Ran to reproduce issue.
  4. cd ~/Code/Reactotron (my local git install)
  5. gh pr checkout 1563 to checkout this PR locally
  6. yarn build in Reactotron to build PR in local package
  7. npx zx scripts/install-workspace-packages-in-target.mjs ~/Code/ReactNative80 to install local reactotron-react-native build on local machine.
  8. cd ~/Code/ReactNative80 && npm run start to run Metro with new install.

I still get these logs but the network plugins works:

The package /Users/joshuayoes/Code/ReactNative80/node_modules/react-native contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "/Users/joshuayoes/Code/ReactNative80/node_modules/react-native/src/private/inspector/XHRInterceptor" defined in "exports" is /Users/joshuayoes/Code/ReactNative80/node_modules/react-native/src/private/inspector/XHRInterceptor.js, however this file does not exist. Falling back to file-based resolution.
 WARN  The package /Users/joshuayoes/Code/ReactNative80/node_modules/react-native contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "/Users/joshuayoes/Code/ReactNative80/node_modules/react-native/Libraries/Network/XHRInterceptor" defined in "exports" is /Users/joshuayoes/Code/ReactNative80/node_modules/react-native/Libraries/Network/XHRInterceptor.js, however this file does not exist. Falling back to file-based resolution.
reactotron-react-native-80-fix.mov

@joshuayoes
Copy link
Contributor

I tested this PR with a [email protected] app by doing:

  1. npx @react-native-community/cli@latest init ReactNative79
  2. Install reactotron-react-native using Quick Start docs.
  3. Ran to reproduce issue.
  4. cd ~/Code/Reactotron (my local git install)
  5. gh pr checkout 1563 to checkout this PR locally
  6. yarn build in Reactotron to build PR in local package
  7. npx zx scripts/install-workspace-packages-in-target.mjs ~/Code/ReactNative79 to install local reactotron-react-native build in my test app.
  8. cd ~/Code/ReactNative79 && npm run start to run Metro with new install.
reactotron-react-native-79-fix.mov

@akuul
Copy link
Contributor Author

akuul commented Jun 23, 2025

Thanks for double checking this!

I believe this might be related to this RFC that got shipped with 0.80.0. However, I agree that warning does not seem to be correlate to what is defined in RFC. Similar thing has been written in their blog post.

XHRInterceptor is defined correctly as you can see on the main branch. I don't recall having these warnings either.

I can take a look tomorrow if there is something to be changed, but if you believe we are good to go, let's go then!

Thanks again

@markrickert
Copy link
Member

I was also able to test and verify on react native 0.79 and 0.80. I also threw 0.76.9 in the mix (expo sdk 52) just to test that last catch statement.

Screenshot 2025-06-23 at 12 42 02 PM

We're good. Thank you so much for this contribution @akuul!

@markrickert markrickert merged commit 187cbc1 into infinitered:master Jun 23, 2025
3 checks passed
@joshuayoes
Copy link
Contributor

Released in [email protected]

@scott-harrison
Copy link

scott-harrison commented Jul 25, 2025

So the error has gone away but im still seeing a warning in metro

The package /Users/me/repos/test-app/node_modules/react-native contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).         █
┃  Reason: The resolution for "/Users/me/repos/test-app/node_modules/react-native/Libraries/Network/XHRInterceptor" defined in "exports" is /Users/me/repos/test-app/n   █
┃  ode_modules/react-native/Libraries/Network/XHRInterceptor.js, however this file does not exist. Falling back to file-based resolution.

is anyone else getting this?

I have installed 5.1.14 and running RN 0.80.2

@FernandoAOborges
Copy link

So the error has gone away but im still seeing a warning in metro

The package /Users/me/repos/test-app/node_modules/react-native contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).         █
┃  Reason: The resolution for "/Users/me/repos/test-app/node_modules/react-native/Libraries/Network/XHRInterceptor" defined in "exports" is /Users/me/repos/test-app/n   █
┃  ode_modules/react-native/Libraries/Network/XHRInterceptor.js, however this file does not exist. Falling back to file-based resolution.

is anyone else getting this?

I have installed 5.1.14 and running RN 0.80.2

I'm getting the same warning using:

"reactotron-react-native": "^5.1.14",
"react-native": "0.80.2"

@joshuayoes
Copy link
Contributor

This warning will continue for the next few versions until this discussion is fruitful:

react-native-community/discussions-and-proposals#893 (reply in thread)

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.

5 participants