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

Fix: CLI Windows Write exe Errors #3239

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/cli/src/serve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ pub(crate) async fn serve_all(mut args: ServeArgs) -> Result<()> {
} else if runner.should_full_rebuild {
tracing::info!(dx_src = ?TraceSrc::Dev, "Full rebuild: {}", file);

// Kill any running executables on Windows
if cfg!(windows) {
runner.kill_all();
}

// We're going to kick off a new build, interrupting the current build if it's ongoing
builder.rebuild(args.build_arguments.clone());

Expand Down Expand Up @@ -215,6 +220,11 @@ pub(crate) async fn serve_all(mut args: ServeArgs) -> Result<()> {
// `Hotreloading:` to keep the alignment during long edit sessions
tracing::info!("Full rebuild: triggered manually");

// Kill any running executables on Windows
if cfg!(windows) {
runner.kill_all();
}

builder.rebuild(args.build_arguments.clone());
runner.file_map.force_rebuild();
devserver.start_build().await
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/serve/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ impl AppRunner {
self.running.remove(&platform);
}

pub(crate) fn kill_all(&mut self) {
self.running.clear();
}

/// Open an existing app bundle, if it exists
pub(crate) async fn open_existing(&self, devserver: &WebServer) {
if let Some(address) = devserver.server_address() {
Expand Down
Loading