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

Feature Request: Add [Show Dev Menu] when specific error occurs. #883

Open
321paranoiawhy opened this issue Feb 28, 2025 · 4 comments
Open

Comments

@321paranoiawhy
Copy link

Introduction

When this specific error occurs:

Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle... 

Image

at the bottom of screen, we can see [DISMISS] and [RELOAD] button for developer convenience.

But can we have a button [Show Dev Menu]?

Details

Why we need this button?

So far, we have and only have two methods to achieve the function of the button:

  • Shake the device, when it is a physical device, we can shake it by hands; when it is a emulator, we can click some button to shake the emulator

  • use adb command when it is an android emulator:

    adb shell input keyevent 82

In most cases, these are enough. But in these cases none of those function well as supposed:

  • the physical device can not response to shake
  • the android emulator keyevent 82 has been used for another function

That's why we need the button for showing dev menu.

Some help

  • This link gives the source code of error text Unable to load script...
  • This link gives the source code of [DISMISS] and [RELOAD] button

Discussion points

Button name

The button name maybe one of these:

  • Show Dev Menu
  • Dev Settings

or use something else

Button Position

The button position maybe one of these:

  • at the bottom of Unable to load script... text with red background
  • at the top of [DISMISS] and [RELOAD] button
@cortinico
Copy link
Member

Out of curiousity: why would you want to open the dev menu on a error screen?

@321paranoiawhy
Copy link
Author

321paranoiawhy commented Mar 1, 2025

Out of curiousity: why would you want to open the dev menu on a error screen?

Sometimes in this screen,we could not show dev menu in any methods because of device limitations or other reason, and this scene should be exactly happened.

Show dev menu so that we can set the server ip:host to correctly connect, or do something else.

Of course, this button can be also a convenience for developer, so we do not need shake the device, we just click the button which is more efficient, convenient and noticeable than shake device to show dev menu.

@321paranoiawhy
Copy link
Author

Can I know what is the next? I am not familiar with rn source code, could someone help?

@cortinico
Copy link
Member

Summoning @huntie as this is a change that involves the DevX are of React Native

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

2 participants