Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Uncaught TypeError: Cannot read property 'apply' of undefined #8

Open
liesislukas opened this issue Feb 11, 2016 · 3 comments
Open

Comments

@liesislukas
Copy link

Console:
image

File:
image

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

@tadeuzagallo
Copy link
Member

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

@liesislukas
Copy link
Author

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.

@sscaff1
Copy link

sscaff1 commented May 12, 2016

I have the same problem. Any updates on this?

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

No branches or pull requests

3 participants