three-object-loader icon indicating copy to clipboard operation
three-object-loader copied to clipboard

FileLoader is not a constructor

Open justin-hackin opened this issue 8 years ago • 1 comments

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)

justin-hackin avatar Aug 03 '17 21:08 justin-hackin

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

justin-hackin avatar Aug 03 '17 21:08 justin-hackin