Attempted import error: 'Date3DTexture is not exported from 'three'

Getting the following error while building a react project in azure DevOps pipeline (able to build the project locally, pretty sure we didn’t change the dependencies):

./node_modules/three-stdlib/loaders/KTX2Loader.js
Attempted import error: 'Date3DTexture is not exported from 'three'.

Deps:

  • “three”: “^0.137.5”,
  • “three-stdlib”: “^2.8.8”,
  • “three.map.control”: “^1.6.0”,
  • @react-three/drei: “^8.8.3”,
  • @react-three/fiber: “^7.0.26”,

Can anyone please help? Thanks!

It looks like three-stdlib requires three.js r138 or higher, if you are using KTX2Loader. The Data3DTexture class was renamed from DataTexture3D in r138. Add new render target types for 3D and array textures. by Mugen87 · Pull Request #23498 · mrdoob/three.js · GitHub

1 Like

Thanks, @donmccurdy, we fixed it by upgrading three to 0.143.0. Though we don’t use KTX2Loader in our code. Cheers!

oh that’s unfortunate that the bundler doesn’t ignore it. i think in dev mode it doesn’t tree-shake yet, only in production. but if updating worked that’s great!

1 Like

Thanks @tirth.patel.ss I can confirm this happens, and that bumping three to 0.143.0 fixes the issue

1 Like