Hi, I’m trying to get oasis running inside an ember-cli app. I’v read all the posts on moment and have ended up trying both amd and non, inclusion of oasis. My steps : 1 . bower install oasis --save 2 . bower install rsvp --save I had to include rsvp because oasis has a dep on it 3 . Brocoli.js
app.import('bower_components/rsvp/rsvp.amd.js', {
exports: {
'rsvp': [
'default',
'defineFixture',
'lookupFixture',
'raw',
'request'
]
}
});
app.import('bower_components/oasis.js/dist/oasis.amd.js', {
exports: {
'oasis': [
'default',
'defineFixture',
'lookupFixture',
'raw',
'request'
]
}
});
module.exports = app.toTree();
4 . View where I want to create a sandbox :
import Ember from 'ember';
// import an amd
import { raw as oasis } from 'oasis';
export default Ember.View.extend({
classNames :['panel', 'panel-default'],
didInsertElement : function(){
var sandbox = oasis.createSandbox({
url: 'http://example.com/profile_viewer.html',
type: 'html',
capabilities: [ 'account' ]
});
this.$('.child-app-m1').append(sandbox.el);
}
});
This builds but in the browser I get :
"Error while processing route: m1" "Could not find module rsvp" "requireModule@http://localhost:4200/assets/vendor.js:58:7
reify@http://localhost:4200/assets/vendor.js:41:9
requireModule@http://localhost:4200/assets/vendor.js:69:7
reify@http://localhost:4200/assets/vendor.js:41:9
requireModule@http://localhost:4200/assets/vendor.js:69:7
reify@http://localhost:4200/assets/vendor.js:41:9
requireModule@http://localhost:4200/assets/vendor.js:69:7
resolveOther@http://localhost:4200/assets/vendor.js:61524:11
apply@http://localhost:4200/assets/vendor.js:31547:18
superWrapper@http://localhost:4200/assets/vendor.js:31125:9
__exports__.default<.resolveView@http://localhost:4200/assets/vendor.js:16757:9
__exports__.default<.resolve@http://localhost:4200/assets/vendor.js:16638:11
resolve@http://localhost:4200/assets/vendor.js:16280:9
resolve@http://localhost:4200/assets/vendor.js:14730:11
Container.prototype.resolve@http://localhost:4200/assets/vendor.js:14325:9
factoryFor@http://localhost:4200/assets/vendor.js:14813:11
instantiate@http://localhost:4200/assets/vendor.js:14866:11
lookup@http://localhost:4200/assets/vendor.js:14751:11
Container.prototype.lookup@http://localhost:4200/assets/vendor.js:14407:9
Route<.render@http://localhost:4200/assets/vendor.js:36887:13
Route<.renderTemplate@http://localhost:4200/assets/vendor.js:36740:9
Route<.setup@http://localhost:4200/assets/vendor.js:36157:11
applyHook@http://localhost:4200/assets/vendor.js:58657:9
callHook@http://localhost:4200/assets/vendor.js:58651:7
handlerEnteredOrUpdated@http://localhost:4200/assets/vendor.js:57411:7
setupContexts/<@http://localhost:4200/assets/vendor.js:57380:11
forEach@http://localhost:4200/assets/vendor.js:58541:37
setupContexts@http://localhost:4200/assets/vendor.js:57379:9
finalizeTransition@http://localhost:4200/assets/vendor.js:57552:9
Router.prototype.transitionByIntent/newTransition.promise<@http://localhost:4200/assets/vendor.js:57052:13
tryCatch@http://localhost:4200/assets/vendor.js:58985:9
invokeCallback@http://localhost:4200/assets/vendor.js:58997:9
publish@http://localhost:4200/assets/vendor.js:58968:11
@http://localhost:4200/assets/vendor.js:42236:9
DeferredActionQueues.prototype.invoke@http://localhost:4200/assets/vendor.js:13801:11
DeferredActionQueues.prototype.flush@http://localhost:4200/assets/vendor.js:13851:15
Backburner.prototype.end@http://localhost:4200/assets/vendor.js:13314:11
Backburner.prototype.run@http://localhost:4200/assets/vendor.js:13369:15
apply@http://localhost:4200/assets/vendor.js:31548:18
run@http://localhost:4200/assets/vendor.js:30166:7
runInitialize@http://localhost:4200/assets/vendor.js:15606:13
jQuery.Callbacks/fire@http://localhost:4200/assets/vendor.js:3230:1
jQuery.Callbacks/self.fireWith@http://localhost:4200/assets/vendor.js:3342:7
.ready@http://localhost:4200/assets/vendor.js:3554:38
completed@http://localhost:4200/assets/vendor.js:3585:3
I tried this in a non amd fashion and got the same result …
So… how do I get oasis to recognise RSVP ??
Cheers, Stephen.