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
{{ message }}
Repository navigation
Bluebird fails to load in a nwjs (nodewebkit) app #525
I can confirm that it worked fine in bluebird version 2.9.3, but I'd say that after commit 98b0252 the issue occurred.
Reading over the code in that commit, it seems to be because typeof window === "undefined"
isn't part of the isNode check. If I add this line manually then my application runs.
Activity
petkaantonov commentedon Mar 12, 2015
Try with at least 2.9.6+
NervosaX commentedon Mar 12, 2015
2.9.6 works. 2.9.13 fails.
I tried every version between 2.9.7 and 2.9.13 and each failed.
petkaantonov commentedon Mar 12, 2015
Does node webkit delete the global setImmediate function or something? That's what's being undefined ... that or process nextTick?
What does process.versions.node say in nw?
NervosaX commentedon Mar 12, 2015
It gives me: "1.2.0"
petkaantonov commentedon Mar 12, 2015
That means
global.setImmediateis undefined, why does nw delete it?NervosaX commentedon Mar 12, 2015
I found this old commit for nw.js nwjs/nw.js#897
Sure enough if I add this line, bluebird will work.
That's pretty unfortunate, as I'm not sure if it should be bluebird's problem to deal with that sort of issue.
petkaantonov commentedon Mar 12, 2015
Well promises should always use nextTick anyway, I am not sure what the reason for the check even was originally. setImmediate is macro task.
Fixes #525
Fixes #525