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

[cli] Fix 'Tunnel URL not found' warning when starting bundler #27566

Merged
merged 1 commit into from Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,7 +19,7 @@ export function createDebugMiddleware(metroBundler: MetroBundlerDevServer) {

const { middleware, websocketEndpoints } = createDevMiddleware({
projectRoot: metroBundler.projectRoot,
serverBaseUrl: metroBundler.getJsInspectorBaseUrl(),
serverBaseUrl: metroBundler.getUrlCreator().constructUrl({ scheme: 'http', hostType: 'lan' }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is host type required here? If it has to be defined, I might need to do some tests (we can still merge it as is). I think I only used getJsInspectorBaseUrl as we previously had this in other places:

const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't specify hostType, tunnel will be used, and given that ngrok would not be running yet we would
get the warning thrown

if (options.hostType === 'tunnel') {
const components = this.getTunnelUrlComponents(options);
if (components) {
return components;
}
Log.warn('Tunnel URL not found (it might not be ready yet), falling back to LAN URL.');

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to merge this in for now because of today's release, but we can adjust this in a follow-up PR if necessary

logger: createLogger(chalk.bold('Debug:')),
unstable_InspectorProxy: ExpoInspectorProxy,
unstable_experiments: {
Expand Down