Skip to content

Slide transition throws a "Invalid keyframe value for property height" warning since Svelte 5Β #14205

@flayks

Description

@flayks

Describe the bug

Using Svelte 4 and before, this REPL custom Accordion with a slide effect was working perfectly. Since Svelte 5, it throws a warning:

Invalid keyframe value for property height: NaNpx

I like the approach of this accordion using {#key isOpen} as it re-runs the transition and also keeps the content in the DOM, only playing with CSS to hide the content when closed.

I haven't made this REPL but adapted it to a similar component in my codebase.

Reproduction

REPL with Svelte 5 (and the warning): https://svelte.dev/playground/a904286e5a4c497daa9e6f9351b3f3a9?version=5
REPL with Svelte 4 (and no warning): https://svelte.dev/playground/a904286e5a4c497daa9e6f9351b3f3a9?version=4

Logs

> Invalid keyframe value for property height: NaNpx

System Info

System:
    OS: macOS 15.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 258.97 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.local/state/fnm_multishells/32005_1720871078955/bin/node
    Yarn: 1.22.19 - ~/.local/state/fnm_multishells/32005_1720871078955/bin/yarn
    npm: 10.9.0 - ~/.local/state/fnm_multishells/32005_1720871078955/bin/npm
    pnpm: 8.5.0 - ~/.local/state/fnm_multishells/32005_1720871078955/bin/pnpm
    bun: 1.1.34 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 130.1.71.118
    Safari: 18.1

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions