Dev console spammed with 'THREE.Clock: This module has been deprecated' on every Canvas mount
What happened?
Every page load and HMR reload of the editor floods the editor#dev terminal (and the browser devtools console) with repeated THREE.Clock: This module has been deprecated. Please use THREE.Timer instead. warnings.
Root cause (verified):
- three.js r183 marked
THREE.Clockas@deprecatedand added a warning inside its constructor (node_modules/three/build/three.core.js:55734). - We don't instantiate
Clockanywhere in this repo (verified viagrep -r "new THREE.Clock" packages apps). @react-three/fiber9.x — current stable, and our pinned version (apps/editor/package.json,packages/editor/package.json,packages/viewer/package.jsonall peer on^0.183and import R3F^9) — still callsnew THREE.Clock()internally per<Canvas>mount (node_modules/@react-three/fiber/dist/events-5a94e5eb.esm.js:972). So every Canvas mount re-triggers the warning.- Upstream is already aware and the migration to
THREE.Timeris done in R3F v10: see pmndrs/react-three-fiber#2688 ("v10: Proposal to revamp the frameloop"), closed with maintainer comment "Done with scheduler in v10" (2026-01-08). However R3F v10 is still alpha (10.0.0-alpha.2latest as of filing) so we can't upgrade out of the problem.
Steps to reproduce
bun dev- Open
http://localhost:3002 - Observe the
editor#devtask panel — every request and every HMR reload prints lines like:[browser] THREE.THREE.Clock: This module has been deprecated. Please use THREE.Timer instead. GET / 200 in 143ms (next.js: 40ms, application-code: 103ms) [browser] THREE.THREE.Clock: This module has been deprecated. Please use THREE.Timer instead. - The same warning also appears in the browser devtools console.
Expected behavior
The editor dev console should not be flooded with deprecation warnings that originate from a transitive dependency we can't upgrade. At minimum the signal-to-noise ratio should stay usable so that real warnings and errors don't get drowned out.
Browser & OS
Chrome / macOS (reproduces in any browser since the warning is emitted from three.js code running client-side)
Additional context
Upstream tracking:
- pmndrs/react-three-fiber#2688 — v10 frameloop revamp that replaces
THREE.ClockwithTimer. Closed, done in v10 branch. This is the fix we are waiting on. - R3F v10 stable release is the cleanest resolution — when it ships and we bump, the warning disappears without any code changes on our side.
Possible interim options (all tradeoffs, no free lunch):
- Wait for R3F v10 stable — zero code, zero risk, unknown timeline.
- Upgrade to
@react-three/[email protected]now — fixes it immediately but pulls in unreleased code; likely brings other breaking changes and instability. - Pin three.js to
0.182.xacross all workspaces — silences the warning because r182 doesn't have the deprecation line, but loses r183 fixes and creates a ceiling on other three-consuming deps. - Local shim via three's
setConsoleFunctionhook — filter just this one message. Prototyped in #212 (now closed) with all the design notes. Leaves a transitional file in the repo that has to be deleted once R3F 10 lands.
Recommendation: default to option 1 (wait). If the noise becomes actively disruptive before R3F 10 ships stable, revisit option 4 — the prototype in #212 has a self-documenting removal condition (grep node_modules/@react-three/fiber/dist for "new THREE.Clock") and the full design review is already in the PR history.
Verification commands for whoever picks this up:
# Confirm our code is clean
grep -rn "new THREE.Clock\|new Clock(" packages apps
# Confirm R3F is still the source
grep -n "new THREE.Clock" node_modules/@react-three/fiber/dist/*.js
# Check latest R3F versions
npm view @react-three/fiber dist-tags
Thanks for the thorough investigation and the prototype in #212 — this was really well done.
We've opened #215 which implements option 4 from your analysis: a surgical setConsoleFunction hook that suppresses only the exact Clock deprecation message while passing everything else through untouched. The implementation follows the same approach you prototyped, with exact-string matching, HMR idempotency, and stack-trace passthrough.
This will hold us over until R3F v10 stable ships and we can upgrade properly. The file has a documented removal condition so it won't get forgotten.
Appreciate you taking the time to research and document all the options — it made the decision straightforward.