-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add setImmediate() #985
Comments
I do not understand,
then you get the |
Tested, it just works. |
@ibc https://github.com/andris9/smtp-connection/blob/master/src/smtp-connection.js#L507 uses a global function setImmediate(). |
Report the issue in that project. https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate Anyhow, why do you want to "browserify" smtp-connection? It is not a browser valid library given that it needs to open raw TCP connections (something unfeasible in a browser). Please close this issue. |
In my project, I have functional node sockets in the browser. I want to send e-mail messages. It actually works already. Certainly not "infeasible". |
Sorry, I do not understand how do you have raw TCP sockets in the browser as that is imposible. Anyhow, I've explained the issue, didn't I? why don't you comment about my rationale? OK, will repeat it: Report the issue in that project. https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate |
BTW you can solve your issue with this workaround:
Not tested. |
I just use websockify and an adapter to Node.js sockets.
See https://github.com/andris9/smtp-connection/issues/9#issuecomment-62950838
It's called node-browserify, so this project is directly related to Node.js. And as such the project might opt to provide a replacement/workaround for the global Node.js setImmediate() function even though it is not part of the ECMA standard. |
Maybe this should have been reported against https://github.com/substack/insert-module-globals which seems to handle these kind of things. |
I agree with your comment in https://github.com/andris9/smtp-connection/issues/9#issuecomment-62950838 |
For reference: http://nodejs.org/api/globals.html says "The timer functions are global variables. See the timers section." |
@ibc Did not test your workaround. Mine looks as follows and seems to work. Thanks anyway. ...
// Inject global function setImmediate()
// See https://github.com/andris9/smtp-connection/issues/9
var insertGlobals = require('browserify/node_modules/insert-module-globals');
insertGlobals.vars.setImmediate = function () {
return "require('timers').setImmediate";
};
var bundle = browserify({
insertGlobals: insertGlobals
});
.... |
Looks good :) |
@substack Could you please explain why this was closed? Should this be reported against https://github.com/substack/insert-module-globals instead? Especially see #985 (comment) |
This falls more into the realm of javascript engines themselves since IE10 and 11 have setImmediate just like node. |
All right, thanks. |
My browser complains about setImmediate() not being defined. This might be something for browserify to handle.
See https://github.com/andris9/smtp-connection/issues/9
The text was updated successfully, but these errors were encountered: