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
AMD version does not work in a node-webkit envrionment #323
Comments
Huh, I'm not really an AMD expert neither - guess we need help from someone else here ;) |
Maybe @rwjblue is an AMD expert? ;) |
I'm pretty sure he is ;) |
Lord help us all... |
Does simple-auth should support node? I think it is aimed to run only in the browser, isn'it? |
In general it's meant to run in Ember apps so if an Ember App runs in node with node-webkit then Ember Simple Auth would want to work as well... However, I never really used node (not to mention Ember + node-webkit) so I don't know much about how that would work. |
In a node-webkit app, Ember runs in the browser (chromium).
|
I don't think Ember defines global |
Basically the AMD wrapper only exists because I wanted the library to show up in Ember's log message that prints all the registered libraries when the application starts. So it would probably make sense to simply change it to //amd.start
(function(global) {
var define = global.define;
var require = global.require;
var Ember = require('ember');
Ember.libraries.register('Ember Simple Auth', '{{ VERSION }}'); //register-library is injected here //amd.end
})(this); which should have the same effect as if the wrapper didn't exist at all if I'm not missing sth. |
Here is a PR that fix the bug: #325 Not sure it is the best way to fix it. Feedback welcome! |
It looks like other libraries don't use a wrapper at all for the AMD distributions. Given that I think |
Right. Updating the PR. |
Done #325 ! |
Using |
should be fixed by #325 |
Hi
Somebody tried to use simple-auth in a amber-cli/node-webkit application.
But AMD version of simple-auth looks for
require
inglobal
, then inwindow
.https://github.com/simplabs/ember-simple-auth/blob/master/packages/ember-simple-auth/wrap/amd.end#L1
This has the drawback of using node's
require
instead of browser'srequire
, and throws a niceUncaught Error: Cannot find module 'ember'
.I don't know very much of AMD, but do we have another option than looking for
require
inglobal
?The text was updated successfully, but these errors were encountered: