Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native compatibility #1

Open
kieran-osgood opened this issue Jan 5, 2024 · 5 comments
Open

React Native compatibility #1

kieran-osgood opened this issue Jan 5, 2024 · 5 comments

Comments

@kieran-osgood
Copy link

kieran-osgood commented Jan 5, 2024

At the moment running inspector in react-native application throws an Error.

 ERROR  TypeError: this.options.window.open is not a function (it is undefined), js engine: hermes

I don't believe it'll be exactly possible to handle opening the browser whilst its running within RN

Could checking for access of window, prior to just opening, and then logging out the url to console be an option to give access as a workaround when working outside of browser

@caltikoc
Copy link

caltikoc commented Jan 5, 2024

  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
I don't believe it'll be exactly possible to handle opening the browser whilst its running within RN

Could checking for access of `window`, prior to just opening, and then logging out the url to console be an option to give access as a workaround when working outside of browser

This error commonly occurs when the entry file (index.js or App.js) is not properly specified or the main component is not registered using AppRegistry.registerComponent. To resolve this issue:

  1. Check your entry file (usually index.js or App.js) to ensure that there is a line similar to AppRegistry.registerComponent('Main', () => App) included. Here, 'Main' represents the name of the main component in your React Native application. Adjust this line to match your app's main component if it differs.

  2. Ensure that this registration line is correctly written and properly executed in your entry file. It should define the main component of your application and register it for the React Native framework to recognize it as the starting point of your app.

By confirming the correct registration of your main component within the entry file using AppRegistry.registerComponent, you can resolve the "Invariant Violation: 'main' has not been registered" error in your React Native application.

@kieran-osgood
Copy link
Author

I've edited the error report to remove those metro violations, those lines were superfluous, that violation occurs due to the preceding error. The app is definitely registered correctly and only errors once adding in the inspector to a machine

@jahglow
Copy link

jahglow commented Feb 14, 2024

Hi, is there any progress on that?

@davidkpiano
Copy link
Member

Hi, is there any progress on that?

We're working on a websocket inspector adapter in this package that should be used instead.

@tnortman-jabra
Copy link

Def a bit hacky, but here's a working fork that works w/RN: https://github.com/tnortman-jabra/stately-inspect/pull/1/files

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

No branches or pull requests

5 participants