Skip to content

Browser lockup when using reactive remote function with LayerChart #18624

Description

@techniq

Describe the bug

When using a reactive remote function, for example:

const data = $derived(await getData(days));

and trigger a change (days) will cause the browser to freeze/lockup.

This same code works if you switch to client-side synchronous data, for example:

const data = $derived(generate(days));

This was first reported as a LayerChart issue but I'm unable to find any cause and looks like a potential svelte async scheduling issue.

Reproduction

repo (notable this route)

<script>
  import { BarChart } from "layerchart";
  import { getData } from "../data.remote";

  let days = $state(30);

  const data = $derived(await getData(days));
</script>

<h1>remote function (async)</h1>

<button onclick={() => (days = days === 30 ? 90 : 30)}>range: {days}d</button>

<BarChart
  data={data.rows}
  x="day"
  series={[
    { key: "a", color: "tomato" },
    { key: "b", color: "steelblue" },
  ]}
  seriesLayout="stack"
  bandPadding={0.2}
  height={300}
/>

Logs

System Info

svelte `5.56.8` (also tried `5.55.10`)

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions