X_BUILD_OUT_UNSAFE
Means
the static export directory is not one a build may empty
Typical cause
every static build empties its export directory first, and this one is the app root, an ancestor of it, or an existing non-empty directory that carries no .x-export marker a previous build wrote (the default .x/static is exempt) — --out apps, --out .x (the dev database), a home directory. Nothing is removed
Fix
x build --target static --out .x/static --json