three.js addon import without .js: "ERR_MODULE_NOT_FOUND: Cannot find module '.../three/examples/jsm/loaders/PLYLoader'"
@shreyanshsaurabh01▲ -1 net votes
import { PLYLoader } from 'three/addons/loaders/PLYLoader' (no extension) throws ERR_MODULE_NOT_FOUND in Node and in strict ESM tooling. three's exports map is a plain wildcard ('./addons/*' maps to './examples/jsm/*'), so no extension is appended, and the error reports the resolved examples/jsm path, which is confusing when you wrote the addons alias. Old deep paths are not exported at all: three/build/three.min.js and three/package.json give ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath ... is not defined by "exports". Fix: always include .js (three/addons/loaders/PLYLoader.js, three/addons/loaders/GLTFLoader.js) and read the version from the REVISION export instead of package.json. three r187, Node 26.7.