`app.import is not a function` unless `included` is defined in addon `index.js`
opened this issue · comments
I was using D3v3 in an addon I am working on, and then switched to your library. I then started seeing this error when I start the addon's nodejs server:
TypeError: app.import is not a function
at /Users/zz/development/ember-sparkles/node_modules/ember-d3-scale/node_modules/ember-cli-d3-shape/index.js:50:17
I discovered that the following minimal amount of code in my addon's index.js
provides a workaround:
module.exports = {
included: function() {
}
// etc
}
It would appear that this might be related to something you fixed earlier, here: ivanvanderbyl/ember-cli-d3-shape#7
That's weird. I'm not quite sure what the implications are of using an addon for an addon that also depends on another addon. (This is the third layer now, right?)
Just perusing through the Ember-cli docs, it shows this — I didn't realize that included
had a second argument:
module.exports = {
name: 'ember-cli-x-button',
included: function(app, parentAddon) {
var target = (parentAddon || app);
// Now you can modify the app / parentAddon.
}
};
So, I'm not sure wether that means that the ember-d3-scale
addon needs to handle this — or if ember-cli-d3-shape
needs to. I can look into this later; but in the meantime, if you want to try seeing if changing the index file in ember-cli-d3-shape
to use something like that instead might work?
@spencer516 thanks... yeah, insert xzibit addon meme here. I tried adding that logic to the index.js
for ember-cli-d3-shape
, no luck, but I may have been doing something wrong. I'm not blocked by this, however - the above mentioned workaround seems to be fine for now.
@spencer516 @ivanvanderbyl we tried to figure this out but we couldn't get it to work. Would you guys mind jumping onto a call with us and try to figure this out? We can also show you what progress we made since the last time that we spoke.
@taras for sure. I've just been travelling the last 2 weeks, finally back with an internet. When would you like to tee up a call? @spencer516
Spencer is coming back on Wednesday. Maybe set something up for Friday?
That works for me. I'm now on CET (Berlin) time.
It'll likely need to be late in the evening for you because @spencer516 is on PST.
No worries
@spencer516 @ivanvanderbyl @taras I can do Friday, am pretty flexible regarding the time. Thanks everyone!
I can do Friday evening between 5pm and 8pm CET (GMT+2). Which is 8a to 11am PST. Let me know what works.
Ok, let's do 9:00am PST which is 6pm for Ivan and noon for me. I'll send a meeting invite to everyone.