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 think this check in the verb.js header, is not correct
// node.js context, but not WebWorker
if ( typeof window !== 'object' && typeof require === "function"){
Worker = require('webworker-threads').Worker;
}
Try opening one of your examples, like http://verbnurbs.com/examples/curveClosestPoint.html
and set a breakpoint there. You can see that window is not defined, even though we are in the browser. Furthermore, it is defined one step above in the call stack.
This makes it think that it's in a node context. In this case nothing happens, because require is not defined. But if you use verb inside a library that it's browserified, require will be defined, and it will require webworker-threads, which creates further problems (browserify won't work if it's not installed, and if you do install it, it will fail at runtime since it's not meant to run in the browser)
In conclusion, either the check is not correct, or window should somehow be defined there when running from a browser.
The text was updated successfully, but these errors were encountered:
I think this check in the
verb.js
header, is not correctTry opening one of your examples, like http://verbnurbs.com/examples/curveClosestPoint.html
and set a breakpoint there. You can see that
window
is not defined, even though we are in the browser. Furthermore, it is defined one step above in the call stack.This makes it think that it's in a node context. In this case nothing happens, because
require
is not defined. But if you use verb inside a library that it's browserified,require
will be defined, and it will requirewebworker-threads
, which creates further problems (browserify won't work if it's not installed, and if you do install it, it will fail at runtime since it's not meant to run in the browser)In conclusion, either the check is not correct, or
window
should somehow be defined there when running from a browser.The text was updated successfully, but these errors were encountered: