Fix Tailwind race condition in fullstack serve mode (#4433)
Skip Tailwind watcher in fullstack mode to prevent race conditions between the watcher and prebuild() both trying to install/run Tailwind simultaneously. In fullstack mode, the client build's prebuild() properly handles Tailwind generation, making the watcher redundant and problematic. Fixes "Text file busy" error when running: dx serve --fullstack true --platform web Fixes #4431
This commit is contained in:
1 parent
71b00ab171
commit
4cb32d372b
1 file changed
+12
-5
@@ -166,11 +166,18 @@ impl AppServer {
|
||||
let client = AppBuilder::new(&client)?;
|
||||
let server = server.map(|server| AppBuilder::new(&server)).transpose()?;
|
||||
|
||||
let tw_watcher = TailwindCli::serve(
|
||||
client.build.package_manifest_dir(),
|
||||
client.build.config.application.tailwind_input.clone(),
|
||||
client.build.config.application.tailwind_output.clone(),
|
||||
);
|
||||
// Only start Tailwind watcher for client builds that serve assets (not server builds or fullstack mode)
|
||||
// In fullstack mode, the client build's prebuild() handles Tailwind generation to avoid race conditions
|
||||
let tw_watcher = if client.build.platform != Platform::Server && !fullstack {
|
||||
TailwindCli::serve(
|
||||
client.build.package_manifest_dir(),
|
||||
client.build.config.application.tailwind_input.clone(),
|
||||
client.build.config.application.tailwind_output.clone(),
|
||||
)
|
||||
} else {
|
||||
// Return a dummy task that immediately completes for server builds or fullstack mode
|
||||
tokio::spawn(async { Ok(()) })
|
||||
};
|
||||
|
||||
_ = client.build.start_simulators().await;
|
||||
|
||||
|
||||
Reference in new issue
Block a user