From 8d26a5d22ecbb1ec440e529fb3e791f4f0b75696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20S=C3=B8holm?= Date: Sat, 4 Oct 2025 03:33:45 +0200 Subject: [PATCH] Fix splitting logic for serve args (#4695) Using .split(' ') for cli arguments causes extra whitespace to become extra arguments, and "".split(' ') returns the empty string instead of nothing. Using split_whitespace() fixes both of these problems. Co-authored-by: Jonathan Kelley --- packages/cli/src/serve/runner.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/serve/runner.rs b/packages/cli/src/serve/runner.rs index 5c539ca31..ba19a3c52 100644 --- a/packages/cli/src/serve/runner.rs +++ b/packages/cli/src/serve/runner.rs @@ -101,7 +101,12 @@ impl AppServer { let cross_origin_policy = args.cross_origin_policy; // Find the launch args for the client and server - let split_args = |args: &str| args.split(' ').map(|s| s.to_string()).collect::>(); + let split_args = |args: &str| { + args.split_whitespace() + .map(|s| s.to_string()) + .collect::>() + }; + let server_args = args.platform_args.with_server_or_shared(|c| &c.args); let server_args = split_args(server_args); let client_args = args.platform_args.with_client_or_shared(|c| &c.args);