Skip to content

[Custom Components] Blocked when using dynamic children for rendering #13131

@Col0ring

Description

@Col0ring

Describe the bug

In gradio 6.9.0, when using dynamic children for rendering, the following error appears in the console and fails to render (the same code works in gradio 6.8.0).

Image

The svelte code:

<script lang="ts">
  import { Gradio } from '@gradio/utils'

  const props = $props()
  // Read props to clean up the loading effect
  new Gradio(props)

  const promise = new Promise<string>((resolve) => {
    setTimeout(() => {
      resolve('hello')
    }, 500)
  })
</script>

{#await promise then value}
  <div>
    {value}
    <!-- not working -->
    {@render props.children?.()}
  </div>
{/await}

<!-- worked -->
<!-- {@render props.children?.()} -->

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Reproduction repo: https://github.com/Col0ring/gradio6.9-dynamic-children-rendering-issue

Screenshot

No response

Logs

System Info

gradio version: 6.9.0
gradio_client version: 2.3.0

Severity

Blocking usage of gradio

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions