Skip to content

fix: pin three.js to 0.182.0 for THREE.Clock deprecation (#204) - #244

Merged
Interstellar-code merged 1 commit into
mainfrom
auto/204-three-clock-deprecated
Jun 20, 2026
Merged

fix: pin three.js to 0.182.0 for THREE.Clock deprecation (#204)#244
Interstellar-code merged 1 commit into
mainfrom
auto/204-three-clock-deprecated

Conversation

@Interstellar-code

Copy link
Copy Markdown
Owner

Closes #204

What

Pins three from ^0.184.0 to 0.182.0 to eliminate the THREE.Clock deprecation warning in the browser console.

Root Cause

THREE.Clock was deprecated in three.js r183. The project was on 0.184.0, which triggers:

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

This warning originates inside @react-three/fiber (v9.6.1, latest stable), which constructs new THREE.Clock() internally in its render loop. The project source code does not use THREE.Clock directly -- it uses R3F's state.clock API (state.clock.elapsedTime, state.clock.getElapsedTime()).

Why pin instead of upgrading R3F?

  • R3F 9.6.1 (latest stable): still uses new THREE.Clock() internally -- no fix available
  • R3F 10.0.0-alpha.2: drops THREE.Clock (uses performance.now() instead), but is alpha -- not appropriate for production
  • R3F issue #3741 tracks this; the fix is targeted for the next major version

Pinning three.js to 0.182.0 (last version before r183 deprecation) is the pragmatic fix that keeps everything on stable releases.

Files Changed

  • package.json -- three version pinned from ^0.184.0 to 0.182.0
  • pnpm-lock.yaml -- lockfile updated

Compatibility

  • @react-three/fiber peer: >=0.156 -- 0.182.0 satisfies
  • @react-three/drei peer: >=0.159 -- 0.182.0 satisfies
  • @react-three/postprocessing peer: >=0.156 -- 0.182.0 satisfies

Test Output

All three checks produce identical results before (0.184.0) and after (0.182.0) the change:

Check Result Pre-existing?
pnpm tsc --noEmit 9 TS7016 errors for three (no bundled types) + other pre-existing errors Yes -- same on 0.184.0
pnpm lint 20268 pre-existing problems Yes -- same on 0.184.0
pnpm test 7 failed / 118 passed (34 tests failed, 1199 passed) Yes -- same on 0.184.0

No new failures, no new errors introduced by this change.

…ning (#204)

THREE.Clock was deprecated in three.js r183. The project is on 0.184.0,
which triggers a console warning: 'THREE.Clock: This module has been
deprecated. Please use THREE.Timer instead.'

@react-three/fiber 9.6.1 (latest stable) still uses new THREE.Clock()
internally. R3F 10.x (alpha) drops it but is not production-ready.

Fix: pin three.js to 0.182.0 (last version before the r183 deprecation).
This eliminates the warning while staying on stable releases. The project
source uses R3F's state.clock API, not THREE.Clock directly.

Verified: identical tsc, lint, and test results before and after.
@Interstellar-code Interstellar-code added auto-loop Created by the coding-loop automation verified Verifier-approved SwitchUI PR and removed auto-loop Created by the coding-loop automation labels Jun 20, 2026
@Interstellar-code
Interstellar-code merged commit 90df6ea into main Jun 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

verified Verifier-approved SwitchUI PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

THREE.Clock deprecated: upgrade @react-three/fiber to fix THREE.Timer warning

1 participant