three-object-loader
three-object-loader copied to clipboard
FileLoader is not a constructor
Your example fails in the context of vuejs in webpack using the vuejs-webpack-template. This may be because the most recent three package uses named exports i.e. normally uses import {Camera...} from 'three'
import OBJLoader from 'three-obj-loader'
// import * as THREE from 'three'
const THREE = require('three')
OBJLoader(THREE)
const objLoader = new THREE.OBJLoader()
(I tried the commented version too)
browser console
Uncaught (in promise) TypeError: THREE.FileLoader is not a constructor
at THREE.OBJLoader.load (index.js?2bee:49)
Seems to be a version sync issue, as newest version of OBJLoader doesn't use FileLoader https://github.com/mrdoob/three.js/blob/cf584a60bdfd24c42eaa81d484533364742bda44/examples/js/loaders/OBJLoader.js and newest THREE doesn't export it