Skip to content

Error: Expected 2 arguments, but got 1. (ts) for <div transition:fade > #785

@bfanger

Description

@bfanger

Since svelte-check 1.1.29 the transition shorthand <div transition:fade> incorrectly reports the
Error: Expected 2 arguments, but got 1. error.

When using the shorthand notation, svelte calls the fade (or any other function) with 2 arguments, the element and an empty object. REPL

To Reproduce

<script lang="ts">
  import { fade } from "svelte/transition";

  let visible = true;

  function toggle() {
    visible = !visible;
  }
</script>

<button on:click={toggle}>Toggle</button>
{#if visible}
  <div transition:fade>Fades in and out</div>
{/if}

Demo: https://github.com/bfanger/svelte-check-transition-bug

The failed run: https://github.com/bfanger/svelte-check-transition-bug/runs/1783108223?check_suite_focus=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions