-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed: setImmediate is not defined #24
Conversation
@jryans Could you please merge this pr if appropriate? I'm working on a project need this very much. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rework this to avoid extra whitespace changes.
main.js
Outdated
}; | ||
|
||
// setimmediate attaches itself to the global object | ||
require("setimmediate"); | ||
exports.setImmediate = setImmediate; | ||
exports.clearImmediate = clearImmediate; | ||
var global = require('global'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use double quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
main.js
Outdated
exports.setImmediate = setImmediate; | ||
exports.clearImmediate = clearImmediate; | ||
var global = require('global'); | ||
exports.setImmediate = global.setImmediate || global.setTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need setTimeout
here? Is setImmediate
not actually attaching to the global at all?
If so, it sounds like something needs to be fixed in the setimmediate
library first. It doesn't seem to return anything on require, so it seems like it needs to be convinced to attach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the global
thing, anyway, i don't use it.
Looks like whitespace changes are still an issue, please use 2 space indents and revert whitespace for unchanged lines. |
@jryans could this pr be merged? |
I do need this very much, would you please spend some time on this pr @jryans |
Thanks for the PR! I merged a slightly tweaked version just now. |
I have published 2.0.3 which should contain the fix. |
Thanks |
Unfortunately, I had to revert this in 2.0.4 for breaking other Webpack users. We'll need better testing if we want to try this again. |
When using module mqtt and webpack, variant setImmediate maybe defined.