Closed ruifortes closed 3 years ago
This works for the then
but there is no catch
and I cannot find a way to detect issues on initialization.
return new Promise((resolve, reject) => {
try { rhino3d().then(rhino => resolve({ rhino })) } catch (e) { reject(e) }
}).then(({ rhino }) => {
console.log("OK rhino", rhino);
}).catch((e) => {
console.error("rhino3dm failure: %s", e)
});
This was caused by some weirdness in the rhino3dm.js produced by Emscripten. I just published v0.14.0 to npm which was built using the latest version of Emscripten (#339) – rhino3dm()
should now return a proper thenable that can also be awaited.
Thanks @cdriesler for the tip!
Why the hell can't I wrap this??
Where is this weirdness coming from? What am I missing here?
Thanks