Skip to content

The doc for CameraUtils says import incorrect exported name "CameraUtils" #26563

@tomphan

Description

@tomphan

Description

The doc says:
import { CameraUtils } from 'three/addons/utils/CameraUtils.js';

However if follow, there will be an error message in the console:
Uncaught SyntaxError: The requested module 'three/addons/utils/CameraUtils.js' does not provide an export named 'CameraUtils'

Actually the code CameraUtils.js exports only the name frameCorners. So the import syntax should be:
import { frameCorners } from 'three/addons/utils/CameraUtils.js';

Reproduction steps

  1. Following the docs: https://threejs.org/docs/index.html#examples/en/utils/CameraUtils
  2. import { CameraUtils } from 'three/addons/utils/CameraUtils.js';

Code

    import { frameCorners } from 'three/addons/utils/CameraUtils.js';

Live example


Screenshots

No response

Version

0.155.0

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions