Zip loader OBJ not loading?

So I’m trying to load a 3d model & mtl file located inside of a zip file with a Zip file loader plugin that takahiro made. The zip loading works fine. but when I do this :

var manager = new THREE.LoadingManager ( );

var url = 'res/game/assets/models/OBJ/female/female.zip';

new Promise ( function( resolve, reject ) {

    if ( url.match( /\.zip$/ ) ) {

        new THREE.ZipLoader ( ).load ( url ).then ( function ( zip ) {

            manager.setURLModifier ( zip.urlResolver );

            resolve ( zip.find ( /\.(obj|mtl)$/i ) [ 0 ] );

        } );

    } else {

        resolve ( url );

    }

} ).then ( function ( file ) {

    new THREE.GLTFLoader ( manager ).load ( file, function ( gltf ) {

        var object = gltf.scene;

        object.traverse ( function ( obj ) {

            if ( obj.material && obj.material.isMeshStandardMaterial ) {

                obj.material.envMap = envMap;

            }

        } );

        scene.add ( object );

    } );

} ).then ( function ( file ) {

    new THREE.OBJLoader ( manager ).load ( file, function ( obj ) {

        var object = obj.scene;

        object.traverse ( function ( obj ) {

            if ( obj.material && obj.material.isMeshStandardMaterial ) {

                obj.material.envMap = envMap;

            }

        } );

        scene.add ( object );

    } );

} );

I get a whole bunch of warnings such as :

OBJLoader.js:706 THREE.OBJLoader: Unexpected line: "<script src="res/game/src/js/loaders/OBJLoader.js"></script>"

and I get 1 error :

TypeError: Cannot read property 'traverse' of undefined
    at main.js:190
    at Object.onLoad (OBJLoader.js:445)
    at XMLHttpRequest.<anonymous> (three.js:36863)

How can I fix this?

You can find the zip loader @ :

It is supposed to be able to load OBJs, MTLs, GLTFs & GLBs.

Any help is GREATLY appreciated as always!

Thank You! <3

I don’t know what I’m doing wrong here.

I’ve not seen any questions related to ZipLoader so far. Have you considered to ask for help directly at the GitHub repository?

It looks like he doesn’t answer his questions.

That is why I’m here.

I have attempted to write a promise function based on both JS Zip & JS Zip utils, along with the above code. What am I doing wrong here with this loader?

var zip = new JSZip.external.Promise ( function ( resolve, reject ) {
	JSZipUtils.getBinaryContent ( 'res/game/assets/models/OBJ/female/female.zip', function ( err, data ) {
		if ( err ) {
			reject ( err );
		}
		else {
			console.log ( data );
			resolve ( data );
		}
	});
} ).then ( function ( zip, data ) {
	const loadingManager = new THREE.LoadingManager ( );
	loadingManager.setURLModifier ( url => {
		const buffer = JSZip.loadAsync ( data ).files [ url ].asUint8Array ( );
		const blob = new Blob ( [ buffer.buffer ] );
		const NewUrl = URL.createObjectURL ( blob );
		console.log ( zip );
		console.log ( buffer );
		console.log ( blob );
		console.log ( NewUrl );
		return NewUrl
	} );
	const mtlLoader = new THREE.MTLLoader ( loadingManager );
	const materials = mtlLoader.parse (
		// unzippedData.file ( 'materials.mtl' ).asText ( )
	);
	const object = new THREE.OBJLoader ( ).setMaterials ( materials ).parse (
		// unzippedData.file ( 'model.obj' ).asText ( )
	);
	return zip;
} ).then ( function ( ) {
	console.log ( 'Model Loaded 100%!' );
} );

Any help as always is GREATLY appreciated!

Thank You! <3