Skip to content

deprecated three js import #3153

Description

@oliverlevymomentum

Issue

fiber/native causes warning from three js version 0.160.0

Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives: https://threejs.org/docs/index.html#manual/en/introduction/Installation

Cause

using import * as THREE from 'three'; will cause the warning because it imports:

  • three.js
  • three.min.js
  • three.cjs
    which are now prefixed with
console.warn('Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+, and will be removed with r160. Please use ES Modules or alternatives: 

allowed imports are

  • three.module.min.js
  • three.module.js
  • three.cjs

I imagine the fix would be to swap
import * as THREE from 'three'
to
import THREE from 'three'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions