# Gradio web components failing to load

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%3E%5C
**Category:** Spaces\
**Created:** [June 22, 2026, 4:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067 "2026-06-22T16:39:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryac](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ryac/32/61492_2.png) [@ryac](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fryac)%5C
**Post date:** [June 22, 2026, 4:39pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F1 "2026-06-22T16:39:03Z")

</div>

Today I noticed my Gradio web component on my site failing; earlier today it was working. The HF space will load the gradio app fine, but when it’s going through the web component it will fail to load.

When looking at the Chrome console it’s calling [https://huggingface.co/api/spaces/by-subdomain/name-of-app](https://huggingface.co/api/spaces/by-subdomain/name-of-app) and the output is:

{  
“error”: “Invalid repo name: name/of\_app - repo name includes an url-encoded slash”  
}

And similar issues on the help pages are found too:

> **[Demos with the Pipeline in transformers - Using Hugging Face Integrations](https://gradio.app/guides/using-hugging-face-integrations#demos-with-the-pipeline-in-transformers)**
>
> The Hugging Face Hub is a central platform that has hundreds of thousands of models, datasets and demos (also known as Spaces). | A Step-by-Step Gradio Tutorial

How can this be fixed?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 23, 2026, 12:42am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F2 "2026-06-23T00:42:40Z")

</div>

Hmm… this could still be a transient glitch, but I wonder if the repository name itself may be part of the trigger:

* * *

This looks less like a problem inside the Space app itself and more like a failure in the Gradio web component’s **Space lookup/status path**.

The main clue is that the failing request is:

```txt
https://huggingface.co/api/spaces/by-subdomain/<space-subdomain>

```

and the error is:

```json
{"error":"Invalid repo name: name/of_app - repo name includes an url-encoded slash"}

```

So, as a quick workaround / diagnostic, I would try the explicit Space repo-id form instead of the `.hf.space` URL form:

```html
<gradio-app space="<owner>/<space_name>"></gradio-app>

```

instead of:

```html
<gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>

```

If `space="<owner>/<space_name>"` works while `src="https://<space-subdomain>.hf.space"` fails, that would strongly suggest that the app itself is fine and the failure is specifically in the `.hf.space` subdomain → Space repo lookup path.

A very similar issue is here:

- [gradio-app/gradio#12570 — 404 Bad Request using Hugging Face Spaces API](https://github.com/gradio-app/gradio/issues/12570)

In that issue, the failing request is:

```txt
GET https://huggingface.co/api/spaces/by-subdomain/jglowa-ai-gov-pl

```

and the response is:

```json
{"error":"Invalid repo name: jglowa/ai-gov.pl - repo name includes an url-encoded slash"}

```

That looks very close to the error pattern here.

> **Why the repository name may matter**
>
> Hugging Face repo ids are normally of the form:
> 
> ```txt
> repo_name
> namespace/repo_name
> 
> ```
> 
> and repo names may contain characters such as:
> 
> ```txt
> -
> _
> .
> 
> ```
> 
> See:
> 
> - [huggingface\_hub `validate_repo_id`](https://huggingface.co/docs/huggingface_hub/package_reference/utilities#huggingface_hub.utils.validate_repo_id)
> 
> So a repo id like this is plausible:
> 
> ```txt
> jglowa/ai-gov.pl
> 
> ```
> 
> But a Space direct URL is exposed as a flattened `.hf.space` subdomain:
> 
> ```txt
> https://<space-subdomain>.hf.space
> 
> ```
> 
> See:
> 
> - [Hugging Face docs: Embed your Space in another website](https://huggingface.co/docs/hub/spaces-embed)
> 
> For example, a repo id like:
> 
> ```txt
> jglowa/ai-gov.pl
> 
> ```
> 
> can become something like:
> 
> ```txt
> jglowa-ai-gov-pl.hf.space
> 
> ```
> 
> That flattening is convenient as a URL, but it can be awkward when something later tries to map the subdomain back to a canonical repo id.
> 
> The difficult cases are names that contain `-`, `_`, `.`, or domain-like parts:
> 
> ```txt
> owner/name-with-dash
> owner/name.with.dot
> owner/name-with-dash.and-dot
> owner/domain-like-name.pl
> 
> ```
> 
> A subdomain can be unique as a serving URL, but that does not automatically mean the subdomain text is a safe reversible encoding of the original repo id.
> 
> I cannot tell from the outside whether the problem is:
> 
> - a fragile reverse mapping,
> - a stale subdomain mapping,
> - custom-domain-related metadata,
> - or a validation bug after a successful lookup.
> 
> But the error message strongly suggests that the `by-subdomain` path is producing or handling a repo id containing `/`, and that is exactly where this kind of name-normalization issue would show up.

> **Why \`space=\` is a useful test**
>
> The documented web component form is:
> 
> ```html
> <gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>
> 
> ```
> 
> So I would not say that using `src="https://<space-subdomain>.hf.space"` is obviously wrong.
> 
> Docs:
> 
> - [Hugging Face Spaces embed docs](https://huggingface.co/docs/hub/spaces-embed)
> 
> However, Gradio also supports a `space` attribute:
> 
> ```html
> <gradio-app space="<owner>/<space_name>"></gradio-app>
> 
> ```
> 
> Docs:
> 
> - [Gradio docs: Sharing Your App / Embedding Hosted Spaces](https://www.gradio.app/guides/sharing-your-app)
> 
> The practical difference is:
> 
> ```txt
> src="https://<space-subdomain>.hf.space"
> → goes through the .hf.space subdomain form
> → may trigger /api/spaces/by-subdomain/<space-subdomain>
> 
> ```
> 
> whereas:
> 
> ```txt
> space="<owner>/<space_name>"
> → uses the canonical Hugging Face Space repo id form
> → can avoid the ambiguous subdomain lookup path
> 
> ```
> 
> So `space="<owner>/<space_name>"` is not just a workaround. It is also a good diagnostic.

> **Suggested tests**
>
> I would test these paths separately:
> 
> | Test | What it tells you |
> | --- | --- |
> | Open `https://<space-subdomain>.hf.space` directly | Checks whether the Space app is actually serving |
> | Embed with an iframe | Checks whether normal browser embedding works |
> | Use `<gradio-app src="https://<space-subdomain>.hf.space">` | Tests the web component + subdomain path |
> | Use `<gradio-app space="<owner>/<space_name>">` | Tests the explicit canonical repo-id path |
> | Open `/api/spaces/by-subdomain/<space-subdomain>` | Tests the failing subdomain metadata lookup |
> | Open `/api/spaces/<owner>/<space_name>` | Tests the canonical repo-id API path |
> 
> Example:
> 
> ```bash
> curl -i https://huggingface.co/api/spaces/by-subdomain/<space-subdomain>
> curl -i https://huggingface.co/api/spaces/<owner>/<space_name>
> 
> ```
> 
> If this combination happens:
> 
> ```txt
> Direct .hf.space URL works
> iframe works
> /api/spaces/<owner>/<space_name> works
> /api/spaces/by-subdomain/<space-subdomain> fails
> <gradio-app src="https://...hf.space"> fails
> <gradio-app space="<owner>/<space_name>"> works
> 
> ```
> 
> then the problem is probably not the Space app code. It would point much more strongly to the `by-subdomain` lookup/status path.

> **Related background issues**
>
> This is not necessarily the same bug, but Gradio web components have had URL / host / base-path resolution issues before where direct access or iframe embedding worked but the web component path failed.
> 
> Examples:
> 
> - [gradio-app/gradio#2883 — Web component embed of Gradio app from HF Space](https://github.com/gradio-app/gradio/issues/2883)
> - [gradio-app/gradio#4463 — web component / path handling issue](https://github.com/gradio-app/gradio/issues/4463)
> - [gradio-app/gradio#7902 — path ignored when loading `/config`](https://github.com/gradio-app/gradio/issues/7902)
> 
> I would not treat those as proof of the current bug. I would only treat them as background evidence that the web component URL-resolution path can fail differently from direct `.hf.space` access or iframe embedding.

> **Useful report format**
>
> If this is reproducible, the most useful report may be something like:
> 
> ```md
> I may be seeing the same `by-subdomain` issue.
> 
> Direct Space URL:
> https://<space-subdomain>.hf.space
> 
> Web component that fails:
> <gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>
> 
> Console request:
> GET https://huggingface.co/api/spaces/by-subdomain/<space-subdomain>
> 
> Response:
> {"error":"Invalid repo name: ... - repo name includes an url-encoded slash"}
> 
> Test with explicit Space id:
> <gradio-app space="<owner>/<space_name>"></gradio-app>
> 
> Result:
> works / fails
> 
> iframe result:
> works / fails
> 
> Direct API checks:
> https://huggingface.co/api/spaces/by-subdomain/<space-subdomain>
> works / fails
> 
> https://huggingface.co/api/spaces/<owner>/<space_name>
> works / fails
> 
> Gradio web component version:
> ...
> 
> Browser:
> ...
> 
> ```

Short version: this may still be a transient platform-side issue, but the specific console error points to the Gradio web component’s `by-subdomain` metadata/status lookup. Testing `space="<owner>/<space_name>"` instead of `src="https://<space-subdomain>.hf.space"` should help separate an app/runtime problem from a subdomain lookup problem.

---

<div class="post-metadata">

**Author:** ![ryac](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ryac/32/61492_2.png) [@ryac](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fryac)%5C
**Post date:** [June 23, 2026, 3:07am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F3 "2026-06-23T03:07:27Z")

</div>

Thanks for this. I tried replacing:

```auto
<gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>

```

With:

```auto
<gradio-app space="<owner>/<space_name>"></gradio-app>

```

What happens is, it goes into an infinite loop while trying to read: https://.hf.space/config over and over, but fails due to a CORS error. After a while I’ll get a 429 error from too many requests and it stops. This is the same problem that happens on the gradio docs site:

[https://gradio.app/guides/using-hugging-face-integrations#demos-with-the-pipeline-in-transformers](https://gradio.app/guides/using-hugging-face-integrations#demos-with-the-pipeline-in-transformers)

For completeness, my web component looks like this after updating to use my owner name and space name:

```auto
<script type="module" src="https://gradio.s3-us-west-2.amazonaws.com/5.49.1/gradio.js"></script>
<gradio-app space="<owner>/<space_name>"></gradio-app>

```

I’m using gradio sdk 5.49.1.

I might try a simple implementation with a newer version from scratch to see if I get the same issue.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 23, 2026, 4:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F4 "2026-06-23T04:21:05Z")

</div>

Thanks. I see. If it happens with that method too, this may connect to [something beyond just Gradio itself](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-spaces-proxy-suddenly-stripping-access-control-allow-credentials-header-on-options-preflight%2F177064)%3A

* * *

The `https://.hf.space/config` part changes the picture quite a bit.

My previous guess was narrower:

```txt
src="https://<space-subdomain>.hf.space"
  → possibly failing through the by-subdomain lookup path

```

But if this also happens with:

```html
<gradio-app space="<owner>/<space_name>"></gradio-app>

```

and the component repeatedly tries to fetch:

```txt
https://.hf.space/config

```

then this looks broader than only a `by-subdomain` reverse-lookup problem.

A literal empty-host URL like this:

```txt
https://.hf.space/config

```

suggests that the web component, or the Hugging Face Space metadata/config resolution path behind it, failed to resolve a valid `.hf.space` host at all.

So I would update the working hypothesis to something like this:

```txt
src="https://<space-subdomain>.hf.space"
  → may fail through by-subdomain lookup

space="<owner>/<space_name>"
  → may fail through owner/name → resolved Space host/config lookup

common layer:
  browser-facing Space identity/config resolution path

```

That is hard to explain as a bug inside the user Space runtime itself.

If the generated URL is literally:

```txt
https://.hf.space/config

```

then the missing value is probably the resolved Space subdomain / host, not something inside the Gradio app running in the Space.

> **Why this seems broader than the original repo-name hypothesis**
>
> The earlier repo-name hypothesis still seems useful for the `by-subdomain` error, especially because of the similar Gradio issue here:
> 
> - [gradio-app/gradio#12570 — 404 Bad Request using Hugging Face Spaces API](https://github.com/gradio-app/gradio/issues/12570)
> 
> In that issue, this request:
> 
> ```txt
> GET https://huggingface.co/api/spaces/by-subdomain/jglowa-ai-gov-pl
> 
> ```
> 
> returns:
> 
> ```json
> {"error":"Invalid repo name: jglowa/ai-gov.pl - repo name includes an url-encoded slash"}
> 
> ```
> 
> That still looks like a suspicious subdomain → repo-id lookup / validation problem.
> 
> But your new result adds another layer:
> 
> ```txt
> space="<owner>/<space_name>"
> → https://.hf.space/config
> 
> ```
> 
> That means the explicit `space=` form does not fully avoid the failing path in your case. Instead, it seems to reach a different failure mode: the component cannot build a valid config URL.
> 
> So I would now separate the possible issues like this:
> 
> | Layer | Example symptom |
> | --- | --- |
> | Repo/subdomain lookup issue | `/api/spaces/by-subdomain/<space-subdomain>` returns `Invalid repo name ... url-encoded slash` |
> | Space host/config resolution issue | web component generates `https://.hf.space/config` |
> | Browser/proxy/CORS issue | config/preflight/browser request fails before useful app logic runs |
> | User app runtime issue | direct `.hf.space` app itself fails |
> 
> Your report seems to point more toward the middle two layers than the last one.

> **Why this may connect to the Spaces proxy / CORS thread**
>
> This may be related to the other recent Spaces proxy/CORS report, although I would not claim the same root cause:
> 
> - [Hugging Face Spaces proxy suddenly stripping Access-Control-Allow-Credentials header on OPTIONS preflight?](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-spaces-proxy-suddenly-stripping-access-control-allow-credentials-header-on-options-preflight%2F177064)
> 
> The common pattern would not be:
> 
> ```txt
> the user app crashed
> 
> ```
> 
> It would be closer to:
> 
> ```txt
> the direct app/runtime may be healthy,
> but a browser-facing Spaces integration path is inconsistent
> 
> ```
> 
> Examples of those browser-facing paths:
> 
> ```txt
> web component config fetch
> Space host resolution
> by-subdomain lookup
> CORS preflight
> Spaces proxy / edge handling
> active service binding
> metadata / route consistency
> 
> ```
> 
> The CORS thread is about a different surface area, but it has a similar diagnostic shape: the problem may be outside the user container if the browser-facing request is answered, rewritten, stripped, cached, or misrouted before it reaches the app.
> 
> Here, `https://.hf.space/config` is similarly suspicious because it looks like the component or metadata layer lost the host before the app could even matter.

> **Checks that may narrow it down**
>
> I would try to separate these paths:
> 
> ```bash
> curl -i https://<space-subdomain>.hf.space/config
> curl -i https://huggingface.co/api/spaces/by-subdomain/<space-subdomain>
> curl -i https://huggingface.co/api/spaces/<owner>/<space_name>
> 
> ```
> 
> And compare the browser behavior of:
> 
> ```html
> <iframe src="https://<space-subdomain>.hf.space"></iframe>
> 
> <gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>
> 
> <gradio-app space="<owner>/<space_name>"></gradio-app>
> 
> ```
> 
> The most useful matrix would be:
> 
> | Test | Result |
> | --- | --- |
> | Direct `https://<space-subdomain>.hf.space` | works / fails |
> | Direct `https://<space-subdomain>.hf.space/config` | works / fails |
> | iframe embed | works / fails |
> | `<gradio-app src="https://<space-subdomain>.hf.space">` | works / fails |
> | `<gradio-app space="<owner>/<space_name>">` | works / fails |
> | `/api/spaces/by-subdomain/<space-subdomain>` | works / fails |
> | `/api/spaces/<owner>/<space_name>` | works / fails |
> | Gradio docs site embed | works / fails |
> | Gradio web component JS version | `5.49.1` / other |
> 
> If direct Space access works but both web component forms fail, then I would stop focusing on the Space app code and treat this as a Gradio web component / HF Space identity-resolution / config-fetch / proxy issue.

Short version: your `space="<owner>/<space_name>"` result makes this look less like only a repo-name-specific `by-subdomain` issue and more like a broader browser-facing Spaces integration problem.

Especially if the web component literally requests:

```txt
https://.hf.space/config

```

then something upstream failed to resolve the Space host before the request even reached the user app.

---

<div class="post-metadata">

**Author:** ![ryac](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ryac/32/61492_2.png) [@ryac](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fryac)%5C
**Post date:** [June 23, 2026, 4:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F5 "2026-06-23T04:58:47Z")

</div>

I created a brand new app from stratch using gradio sdk version 6.19.0. Deployed successfully.

# **Results**

## Test 1 (works)

Direct access to https://[space-subdomain].hf.space

## Test 2 (works)

Direct access to https://[space-subdomain].hf.space/config

## Test 3 (works)

iFrame works.

## Test 4 (fails)

Embedding as web component with subdomain fails.

```auto
<gradio-app src="https://[space-subdomain].hf.space">

```

## Test 5 (fails)

Embedding web compontent with owner/space fails.

```auto
<gradio-app space="<owner>/<space_name>">

```

## Test 6 (fails)

Calling the URL below will fail:

```auto
https://huggingface.co/api/spaces/by-subdomain/[subdomain]

```

Result:

```auto
HTTP/2 400 
content-type: application/json; charset=utf-8
content-length: 89
date: Tue, 23 Jun 2026 04:39:50 GMT
etag: W/"59-W4Wj6ETpoa9k7JmLJHDRpTMRfQU"
x-powered-by: huggingface-moon
x-request-id: Root=1-6a3a0e16-3c72985c5f7ccbf1605d998f
ratelimit: "api";r=499;t=103
ratelimit-policy: "fixed window";"api";q=500;w=300
cross-origin-opener-policy: same-origin
referrer-policy: strict-origin-when-cross-origin
access-control-max-age: 86400
access-control-allow-origin: https://huggingface.co
vary: Origin
access-control-expose-headers: X-Repo-Commit,X-Request-Id,X-Error-Code,X-Error-Message,X-Total-Count,ETag,Link,Accept-Ranges,Content-Range,X-Linked-Size,X-Linked-ETag,X-Xet-Hash
x-error-message: Invalid repo name: owner/space - repo name includes an url-encoded slash
x-cache: Error from cloudfront
via: 1.1 744a1a944313f4cfdfc83fe056d50e50.cloudfront.net (CloudFront)
x-amz-cf-pop: SIN2-P7
x-amz-cf-id: b56oFSz97_nflnS2BDFZGFm1wwInQ2B_HuKJVIlGNwqTJ7XaPg_Gdg==

{"error":"Invalid repo name: owner/space - repo name includes an url-encoded slash"}

```

## Test 7 (works)

[https://huggingface.co/api/spaces/owner/space](https://huggingface.co/api/spaces/owner/space)

I’m stuck on what to try next here!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 23, 2026, 6:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgradio-web-components-failing-to-load%2F177067%2F6 "2026-06-23T06:52:43Z")

</div>

Nice! Thanks, I think that test narrows it down quite a lot:

* * *

The useful boundary now seems much clearer.

From your matrix:

```txt
Works:
- direct https://<space-subdomain>.hf.space
- direct https://<space-subdomain>.hf.space/config
- iframe
- https://huggingface.co/api/spaces/<owner>/<space_name>

Fails:
- <gradio-app src="https://<space-subdomain>.hf.space">
- <gradio-app space="<owner>/<space_name>">
- https://huggingface.co/api/spaces/by-subdomain/<subdomain>

```

That is a very useful separation.

It makes this look much less like a Space runtime / app-code problem, because the direct app path, direct `/config`, iframe embedding, and canonical Space API path all work.

The clearest broken piece is now:

```txt
https://huggingface.co/api/spaces/by-subdomain/<subdomain>

```

especially because it returns:

```txt
HTTP 400
Invalid repo name: owner/space - repo name includes an url-encoded slash

```

while this works:

```txt
https://huggingface.co/api/spaces/<owner>/<space_name>

```

So I would now frame the issue as:

```txt
canonical/direct paths work,
derived/browser-facing integration paths fail

```

or more concretely:

```txt
direct Space runtime:
  works

direct Gradio /config:
  works

iframe:
  works

canonical HF Space API:
  works

by-subdomain lookup:
  fails

Gradio web component:
  fails

```

That strongly points away from the user app and toward the web component’s Space identity/status/config-resolution path, with `/api/spaces/by-subdomain/<subdomain>` being the most obvious failing endpoint.

> **Updated hypothesis**
>
> My earlier guess was:
> 
> ```txt
> repo name / by-subdomain reverse lookup may be the trigger
> 
> ```
> 
> After your latest test, I would update it to:
> 
> ```txt
> /api/spaces/by-subdomain/<subdomain> appears broken,
> and the Gradio web component seems to depend on that endpoint
> or on a closely related Space identity/status/config-resolution path.
> 
> ```
> 
> The important distinction is:
> 
> ```txt
> /api/spaces/<owner>/<space_name>
> works
> 
> /api/spaces/by-subdomain/<subdomain>
> fails
> 
> ```
> 
> So the canonical repo-id path seems healthy, but the derived subdomain lookup path does not.
> 
> That also explains why this is probably not fixed by changing the Space app itself: the app is already reachable, and `/config` is already reachable directly.

> **How I would summarize the bug report upstream**
>
> I think this is now a fairly clean minimal report:
> 
> ```md
> Brand new Gradio Space
> Gradio SDK version: 6.19.0
> Web component JS: 5.49.1
> 
> Works:
> - https://<space-subdomain>.hf.space
> - https://<space-subdomain>.hf.space/config
> - iframe embed
> - https://huggingface.co/api/spaces/<owner>/<space_name>
> 
> Fails:
> - <gradio-app src="https://<space-subdomain>.hf.space"></gradio-app>
> - <gradio-app space="<owner>/<space_name>"></gradio-app>
> - https://huggingface.co/api/spaces/by-subdomain/<subdomain>
> 
> Failing response:
> HTTP 400
> Invalid repo name: owner/space - repo name includes an url-encoded slash
> 
> ```
> 
> This seems related to:
> 
> - [gradio-app/gradio#12570 — 404 Bad Request using Hugging Face Spaces API](https://github.com/gradio-app/gradio/issues/12570)
> 
> But your matrix is cleaner because it shows that direct access, `/config`, iframe, and `/api/spaces/<owner>/<space_name>` all work.

> **Relation to the Spaces proxy / CORS thread**
>
> I would not claim this has the same root cause as the recent Spaces proxy / CORS thread:
> 
> - [Hugging Face Spaces proxy suddenly stripping Access-Control-Allow-Credentials header on OPTIONS preflight?](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-spaces-proxy-suddenly-stripping-access-control-allow-credentials-header-on-options-preflight%2F177064)
> 
> But I do think it may belong to the same broad diagnostic class:
> 
> ```txt
> the app/runtime path may be healthy,
> while a browser-facing Spaces integration path is inconsistent
> 
> ```
> 
> For this Web Component issue, the suspicious browser-facing paths are:
> 
> ```txt
> Space identity lookup
> by-subdomain lookup
> web component status/config resolution
> 
> ```
> 
> For the CORS issue, the suspicious browser-facing paths are:
> 
> ```txt
> OPTIONS preflight
> Spaces proxy / edge handling
> CORS header preservation
> active service binding
> 
> ```
> 
> Different surface areas, but similar shape:
> 
> ```txt
> direct app path may work,
> while a derived/proxy/metadata/browser-facing path fails
> 
> ```
> 
> So I would not merge them as the same bug without more evidence, but I would keep them in the same investigation bucket: Spaces proxy / route / metadata / identity-resolution consistency.

At this point, I would probably stop focusing on the app code and report this as a Gradio Web Component / Hugging Face Spaces `by-subdomain` or Space identity-resolution bug.

Short version:

```txt
The Space works.
The direct /config endpoint works.
The canonical Space API works.
The iframe works.

The failing pieces are:
- by-subdomain
- Gradio Web Component embedding

```

That is a pretty strong signal that the failure is outside the user app runtime.
