-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Uncaught module 'emitter' not found #95
Comments
i have a different module for the client called "emitter" for something I'm working on, but maybe we can add support for "events" since browserify will use this too |
Okay, I think I messed up something. You're checking for an "exports" variable which should only exist when running on node. But stitch is supplying Also, the events.js is only working when prepended to superagent.js - not when |
well the thing is that it's detecting |
Yeah, it would be nice to be able to use this with browserify as well. One alternative I can see is to set a different main with browserify, i.e. specify "browserify" : "browserifyEntry.js" in package.json. Then move the eventEmitter stuff to the two entry points, and injected the right one in those. This should make the packaged code slimmer as well. |
👍 having this issue while using superagent inside |
I've just found out it's because of superagent index.js file: if (typeof window != 'undefined') {
module.exports = require('./lib/superagent');
} else if (process.env.SUPERAGENT_COV) {
module.exports = require('./lib-cov/node');
} else {
module.exports = require('./lib/node');
} :| I don't know if this is node-webkit responsibility or superagent's. |
@tomasdev It's super agents. However things could get complicated and messy when detecting node-webkit over browsers. I'd suggest something like: if((typeof process != 'undefined' && process.versions['node-webkit']))
// This is node-webkit! |
@tomasdev thats odd... superagent supports the browser and node, not sure what node-webkit could be doing to mess up the node or webkit side of things. |
Closing this for now because people are using superagent fine in the browser via the download file, component or even browserify. @tomasdev I am certain that's going to be node-webkit's problem, but feel free to open a newer issue if you feel differently. |
@gjohnson The issue is that node-webkit exposes a global |
gah haha fragmentationnnn.. |
@tomasdev I'm considering removing the |
@rogerwang What exactly do you mean? |
I mean the global |
@rogerwang But would that not affect all the other applications built to use window? I'm not sure I understand what you mean by "Node Context" |
@rogerwang @jduncanator @tomasdev I am interested in this conversation, but for the sake of other watchers/maintainers on here, let's move this to a thread on node-webkit. Please paste the issue link. Thanks! |
Please discuss here in future: nwjs/nw.js#1588 |
Shouldn't it be "events"?
I'm using superagent in the browser with stitch, cf my comment on 8acb989.
The text was updated successfully, but these errors were encountered: