Fix opening native targets while they are still building and retry tcp connections to avoid server is still loading page (#5358)

* retry tcp connections

* don't open native binaries that don't exist

* fix formatting

* fix proxy
This commit is contained in:
Evan Almloff authored and GitHub committed 2026-03-13 13:01:42 -05:00
1 parent f472349012
commit 77a50f916f
2 files changed
+91 -51

No files matched your search

+25 -14
View File
@@ -649,21 +649,32 @@ impl AppServer {
let displayed_address = devserver.displayed_address();
// Always open the server first after the client has been built
// Only open the server if it isn't prerendered
// Only open the server if it isn't prerendered and finished building
if let Some(server) = self.server.as_mut().filter(|_| !self.ssg) {
tracing::debug!("Opening server build");
server.soft_kill().await;
server
.open(
devserver_ip,
displayed_address,
fullstack_address,
false,
false,
BuildId::SECONDARY,
&self.server_args,
)
.await?;
if server.stage < BuildStage::Success {
tracing::trace!("Skipping server open: will open once build completes");
} else {
tracing::debug!("Opening server build");
server.soft_kill().await;
server
.open(
devserver_ip,
displayed_address,
fullstack_address,
false,
false,
BuildId::SECONDARY,
&self.server_args,
)
.await?;
}
}
// Skip opening native client if still building (web can open anytime)
if self.client.build.bundle != BundleFormat::Web && self.client.stage < BuildStage::Success
{
tracing::trace!("Skipping client open: will open once build completes");
return Ok(());
}
// Start the new app before we kill the old one to give it a little bit of time