R183.0 Only - AudioListener Generates Clock Error Notice

After updating some of my programs to r183, I am getting the following non-fatal notice in Chrome:

THREE.THREE.Clock: This module has been deprecated.  
Please use THREE.Timer instead.

However, those programs either do not call the clock routine or have switched to the timer module. I have checked the modules that they call and there are none with references to clock or timer.

I will try to figure out the difference between the programs with the error notice and those without.

In the meantime, has anyone else run into this problem or have any idea what might be causing this notice?

2 Likes

In Chrome, at least, you should be able to see the stack trace for a warning which should tell you what is instantiating the Clock. Otherwise you can set a breakpoint on the Clock warning to check, as well.

3 Likes

Thanks. Those are features which I have not used and which sound extremely useful.

Starting in the console panel, the stack trace just takes me back to the line of code within the warn function where the warning is generated. (three.core.js: 2001).

It appears that the warn function just displays errors from a master list of warnings generated while the program is running. So I would need to somehow find the place where the warning is added to the list. Any idea how I could easily do that in Chrome?

In the meantime, I can continue debugging “caveman style” by deactivating functions to see when the error disappears. I have another program that uses a lot of the same functions, but which does not generate the error. So the offending function should in the difference between those two programs.

Can you put a breakpoint at that specific warning? (The line 2001)

Got it!

The error notice is created by the AudioListener.

[UPDATE: My understanding below was backwards. Issue #33026 was raised after r183 was released. It has already been fixed and will be included in r184.]

The reference to Clock was supposed to have been replaced with Timer (#33026)
[see three.js/src/audio/AudioListener.js at 33b6ce05a72be0b49cc84cdbb7b5cc972036eebc · mrdoob/three.js · GitHub]
However, it was not (see three.core.js, line 50244).

Clock is deprecated but still works, so this should not be a problem and can be fixed in r184.

[ADD: Feb 22] I was just advised that this fix is part of r183.1 which is already available.

2 Likes

Nice catch! I saw they fixed that a couple of days ago. I wonder how timer is different from the clock.

Yes, I hadn’t realized that this error had been caught just after r183 was released.

Apparently Timer is more dependable than Clock in that you can call Timer several times per simulation step without getting different values. However, unlike Clock, you need to add an update instruction at the end of each simulation step or it will remain stuck on the same value. I discovered this last requirement when one of my programs appeared to freeze.

2 Likes