[cli] Fix start hermes debugger crash when starting with --dev-client #19919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
a regression from #19872 which starting dev-server with
--dev-client
parameter and pressingj
to launch hermes debugger. the cli will crash withTypeError: Only HTTP(S) protocols are supported
.How
with
--dev-client
parameter, the returned getNativeRuntimeUrl will not bescheme://expo-development-client/?url=...
. since the url is quite different between expo-go and dev builds. this pr adds agetJsInspectorBaseUrl
specific for the inspector server.getDevServerUrl
getDevServerUrl
will returnhttp://localhost
by default which breaks on windows. this is what [cli][dev-server] Fix hermes debugger error on windows and linux #19872 originally trying to address.getExpoGoUrl
getExpoGoUrl
is a protected method in the server. even though we could access the internal property byserver['getExpoGoUrl']().replace(/^exp:\/\//, 'http://')
. that is not clear and not having a typescript typing in BundlerDevServer.Test Plan
npx expo start
and pressj
npx expo start --dev-client
and pressj
Unit Test
Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).