Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no interval scheduled with the given id #415

Closed
VictorPulzz opened this issue Jun 3, 2021 · 2 comments
Closed

There is no interval scheduled with the given id #415

VictorPulzz opened this issue Jun 3, 2021 · 2 comments

Comments

@VictorPulzz
Copy link

Hello, I try using you lib in vue.js, and got some issue:

module.js:67 Uncaught Error: There is no interval scheduled with the given id "1".

I do not understand why, I am doing everything right ...
Can you help me?
image

@chrisguttandin
Copy link
Owner

Hi @VictorPullzz,

is it possible that you call workerTimers.clearInterval(timeInterval) multiple times with the same timeInterval? If so you could fix your code by setting timeInterval to null after clearing the interval.

stopCurrentTimer: () => {
    if (timeInterval) {
        workerTimers.clearInterval(timeInterval);
        timeInterval = null;
    }
}

Calling workerTimers.clearInterval with a value that doesn't belong to an active timer throws an error: https://github.com/chrisguttandin/worker-timers#error-handling.

I hope this helps.

@chrisguttandin
Copy link
Owner

Since v8 worker-timers should no longer throw an error when calling clearInterval() or clearTimeout() with an unknown id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants