You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using .map to call a function that is defined right before the call, let's name it doSomething().
If doSomething doesn't use any other functions internally, it all seems to work: the workers start, and my callback, added with .then(this.onLoadCallback), gets called. Yey!
Now, if I add this to doSomething:
var point = new THREE.Vector3();
something is failing, because it never gets to my callback, even if I add THREE.Vector3 to .require.
This is how I call map:
var p = new Parallel(data);
p.require(doSomething, THREE.Vector3).map(doSomething).then(this.onLoadCallback);
I debugged a bit, and when Parallel.prototype.getWorkerSource is called, I see the code for both doSomething and Vector3 ending up in preStr, but still something is going wrong.
In case it matters, the code is concatenated with no space or any characters between the 2 separate snippets.
I will continue debugging, but in the meantime I thought I'd post here, in case I'm missing something obvious.
Thanks!
The text was updated successfully, but these errors were encountered:
Just added a failure callback, and this is what the error message says:
Uncaught ReferenceError: THREE is not defined
The source code is retrieved properly, but when the code for doSomething is executed, it seems it can't resolve THREE.Vector3(), probably because the definition that ends up in preStr does NOT include the THREE namespace.
Hi there!
I'm using
.map
to call a function that is defined right before the call, let's name itdoSomething()
.If
doSomething
doesn't use any other functions internally, it all seems to work: the workers start, and my callback, added with.then(this.onLoadCallback)
, gets called. Yey!Now, if I add this to
doSomething
:var point = new THREE.Vector3();
something is failing, because it never gets to my callback, even if I add
THREE.Vector3
to.require
.This is how I call map:
I debugged a bit, and when
Parallel.prototype.getWorkerSource
is called, I see the code for bothdoSomething
andVector3
ending up inpreStr
, but still something is going wrong.In case it matters, the code is concatenated with no space or any characters between the 2 separate snippets.
I will continue debugging, but in the meantime I thought I'd post here, in case I'm missing something obvious.
Thanks!
The text was updated successfully, but these errors were encountered: