{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreies346j6bz4xm6b3vplq4d747nu2sa5gsceypi56ldvguavmsv3x4",
    "uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mebhcosznpt2"
  },
  "path": "/t/hf-space-static-sdk-is-not-supported/173178#post_2",
  "publishedAt": "2026-02-07T12:16:31.000Z",
  "site": "https://discuss.huggingface.co",
  "tags": [
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face",
    "Hugging Face"
  ],
  "textContent": "That probably won’t be a problem…\n\nSometimes the cache causes issues; in those cases, you can clear it by making a meaningless change to the `sdk:` line and then reverting it…\n\n* * *\n\n## Is it a problem that you don’t have `app_build_command`?\n\nNo.\n\nStatic Spaces can work in **either** of these modes:\n\n  1. **You commit the built files** (e.g., `dist/`) and set `app_file` to the HTML entrypoint.\n  2. **Hugging Face builds for you** by running `app_build_command` on every update and then serving the output from a special build ref (`refs/convert/build`). (Hugging Face)\n\n\n\nSo missing `app_build_command` is only a problem if `dist/index.html` is not present (or not where `app_file` points) in the repo revision the Space is serving.\n\n* * *\n\n## Why it “worked at first” and then later changed to “Static SDK is not supported”\n\nThat message is a _configuration-level_ failure. In practice it usually comes from one of these:\n\n### 1) Your README config is not being parsed as Spaces configuration (very common)\n\nSpaces only read settings from the **YAML front-matter block at the very top of`README.md`**. (Hugging Face)\n\nIf you literally added:\n\n\n    sdk: static\n    app_file: dist/index.html\n\n\n…but **not** inside a top-of-file YAML front-matter block, Hugging Face may ignore it and fall back into a “configuration error” state.\n\n**What “correct” looks like:**\n\n\n    ---\n    sdk: static\n    app_file: dist/index.html\n    ---\n\n\n**Pitfalls that break parsing**\n\n  * The YAML block is **not the first thing** in the README (badges/text above it).\n  * It’s inside a Markdown code fence (```).\n  * It contains placeholders or invalid YAML.\n  * It was edited later and became malformed.\n\n\n\nThere are public examples where a misconfigured/template README ends up showing the same “Static SDK is not supported” configuration error page. (Hugging Face)\n\n**Why the delay?**\n\n  * The Space can appear fine until a rebuild/restart causes Hugging Face to re-evaluate config strictly, or until a platform-side validation change takes effect.\n\n\n\n* * *\n\n### 2) Your Space is still set to **ZeroGPU** from the old Gradio setup\n\nZeroGPU has a hard constraint: **ZeroGPU Spaces are exclusively compatible with the Gradio SDK** , not static. (Hugging Face)\n\n**Why the delay?**\n\n  * It might run briefly (or show cached content), then once the runtime config is enforced/rebuilt it flips into an error state.\n\n\n\n**Fix**\n\n  * Space **Settings → Hardware** : switch away from ZeroGPU to a CPU tier (or standard GPU where applicable), then rebuild.\n\n\n\n* * *\n\n### 3) Dev Mode is enabled\n\n**Dev Mode is not available for static Spaces.** (Hugging Face)\n\n**Fix**\n\n  * Space **Settings → Dev Mode** : disable, then rebuild.\n\n\n\n* * *\n\n### 4) `app_file` path format/validation changed (edge case)\n\nA recent “it randomly stopped working” case was caused by `app_file` syntax being slightly off and fixed by changing `./index.html` → `index.html`. ([Hugging Face Forums](https://discuss.huggingface.co/t/my-space-randomly-stopped-working-no-application-file/170511 \"My space randomly stopped working. \"No application file\"\"))\n\nYour `dist/index.html` form is the recommended pattern in the docs, but it’s worth verifying you didn’t accidentally use a leading `./` or `/` in the actual README. (Hugging Face)\n\n* * *\n\n### 5) `dist/` is missing (or stale) in the revision being served\n\nIf you don’t use `app_build_command`, Hugging Face serves whatever is committed. If `dist/index.html` isn’t present (or you pushed a commit without rebuilding locally), you can land in a broken state.\n\n**Fix**\n\n  * In the Space “Files” view, confirm `dist/index.html` exists on the current commit and matches `app_file`.\n\n\n\n* * *\n\n## What I would do for _your_ case (fastest path)\n\n### Step 1 — Make the README config unquestionably valid\n\nPut this **as the first lines** of `README.md` (no text above it):\n\n\n    ---\n    sdk: static\n    app_file: dist/index.html\n    ---\n\n\nThis is required because Spaces configuration is read from the README YAML block. (Hugging Face)\n\n### Step 2 — Check Settings for static-incompatible modes\n\n  * If Hardware is **ZeroGPU** → change to CPU. (Hugging Face)\n  * If **Dev Mode** is enabled → disable it. (Hugging Face)\n\n\n\n### Step 3 — Verify the entrypoint exists\n\nConfirm the repository (current commit) contains: `dist/index.html` and that it loads without needing server-side routing.\n\n* * *\n\n## “Should we add `app_build_command` anyway?”\n\nIt’s optional, but often improves reliability for teams because it prevents “forgot to commit dist” and makes deploys reproducible.\n\nStatic docs describe this build mode: Hugging Face runs your build command on each update and serves the output from `refs/convert/build`. (Hugging Face)\n\nA typical config:\n\n\n    ---\n    sdk: static\n    app_build_command: npm ci && npm run build\n    app_file: dist/index.html\n    ---\n\n\n(You can use bun, but the most predictable path is using the toolchain Hugging Face documents directly—`npm run build`—unless you’ve verified bun availability in the build environment.) (Hugging Face)\n\n* * *\n\n## Quick checklist mapping to your symptoms\n\n  * You pasted config **without** `---` front-matter → very likely cause. (Hugging Face)\n  * Space previously used **ZeroGPU** with Gradio → likely cause. (Hugging Face)\n  * Dev Mode enabled during debugging → likely cause. (Hugging Face)\n  * `app_file` format subtly changed (`./…`) → possible. ([Hugging Face Forums](https://discuss.huggingface.co/t/my-space-randomly-stopped-working-no-application-file/170511 \"My space randomly stopped working. \"No application file\"\"))\n\n",
  "title": "HF Space \"Static SDK is not supported\""
}