question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript error on event invocation with argument

See original GitHub issue

After the last update with the improved types, I now get an error whenever I invoke an event with an argument.

state.paginate(page);
Error: Expected 0 arguments, but got 1. (ts)
    state.paginate(page);

Thanks a lot for this library, really useful!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
f-elixcommented, Dec 14, 2021

@kenkunz @ivanhofer Works great! Thanks so much for the quick work, really appreciate it.

Just so you know, my agency switched to Sveltekit and we’re going to be using svelte-fsm in production for some of our components!

2reactions
f-elixcommented, Dec 13, 2021

Wow that was fast! Thanks a lot.

@ivanhofer I tried that already but my configuration still won’t allow it (and I can’t really change it). In any case, this is easy to work around, I just thought it should be addressed since it’s a core part of the API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript union types - error only on function invocation
The handler function assumes that a non-boolean non-object parameter must be a string, but SomeFunction calls _props.onChange() with a number.
Read more >
EventTarget.removeEventListener's second argument is ...
TypeScript Version: 2.2.0 Code // this throws at runtime due to the missing second argument, // but it typechecks as the second argument...
Read more >
Documentation - Do's and Don'ts
Optional Parameters in Callbacks​​ This has a very specific meaning: the done callback might be invoked with 1 argument or might be invoked...
Read more >
Functions - TypeScript: Handbook
Functions are the fundamental building block of any application in JavaScript. They're how you build up layers of abstraction, mimicking classes, ...
Read more >
Documentation - TypeScript 3.7
Uncalled Function Checks. A common and dangerous error is to forget to invoke a function, especially if the function has zero arguments or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found