8000 Items used only inside `#await then` blocks seem to get tree-shaken by rollup >= 4.27 · Issue #14346 · sveltejs/svelte · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Items used only inside #await then blocks seem to get tree-shaken by rollup >= 4.27 #14346
Closed as not planned
@job79

Description

@job79

Describe the bug

After updating to rollup 4.27 some of the icons inside my project stopped working. After some searching the problem seems to be related to the vanishing icons only being used inside #await then blocks. Downgrading to rollup 4.26 or including the icons anywhere outside of an #await then fixes the issue.

The issue only occurs when building the project, icons work fine when running npm run dev. I am using the static adapter.

Reproduction

https://git.plabble.org/Job79/Svelte-tree-shake-issue

<script lang="ts">
  import Fa from "svelte-fa";
  import {
    faMinusCircle,
    faPlusCircle,
  } from "@fortawesome/free-solid-svg-icons";

  const wait = (milliseconds: number) =>
    new Promise((resolve) => setTimeout(resolve, milliseconds));
</script>

<div>
  {#await wait(100) then}
    <div>
      Icon1: <Fa icon={faPlusCircle} />
    </div>
    <div>
      Icon1 isn't shown when building with rollup >= 4.27. It does get shown
      when placed outside the await or when included anywhere else.
    </div>
  {/await}

  <div>
    Icon2: <Fa icon={faMinusCircle} />
  </div>
  <div>No problems when showing icons outside of an #await</div>
</div>

Logs

No response

System Info

System:
    OS: Linux 5.15 Fedora Linux 41 (Container Image)
    Container: Yes
    Shell: 5.2.32 - /bin/bash
  Binaries:
    Node: 22.11.0 - /usr/bin/node
    npm: 10.9.0 - /usr/bin/npm

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

      0