reactjs / react-timer-mixin

TimerMixin provides timer functions for executing code in the future that are safely cleaned up when the component unmounts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError: Cannot read property 'apply' of undefined

liesislukas opened this issue · comments

Console:
image

File:
image

No other errors, just this comes time to time, somewhere setter is used incorrectly.

Can you inspect what is the value of callback? Could you have called set(Interval|Timeout|Immediate) with something other than a function?

i guess callback is "undefined" - how error says. haven't yet found what's causing this error, because it's happening at random time, can't see pattern yet. Reviewed all code connected with setTimeout and setInterval, Immediate not used anywhere. It might be happening, that function was not there at time when "setInterval" was called, made some code re-order and it seems error is gone now.

I think there should be if-clause with check about callback

if(typeof callback !== 'function'){
    console.warn('#4dfs4df callback function is not a function:');
    console.warn(callback);
}

i like this way of console warning/logs/error because it gives some ID to find this error in code + gives current value of callback, that was passed to f-ction. Adding backtrace would be lovely too.

I have the same problem. Any updates on this?