jasonmit / ember-cli-moment-shim

ember-cli shim for momentjs
MIT License
33 stars 59 forks source link

Funnel: Expected Broccoli node, got undefined for inputNodes[0] #150

Closed noplisu closed 6 years ago

noplisu commented 6 years ago

I am creating a ember addon. When adding ember-cli-moment-shim to dependencies in package.json I am getting an error:

TypeError: Funnel: Expected Broccoli node, got undefined for inputNodes[0]
    at Funnel.Plugin (node_modules/broccoli-plugin/index.js:23:13)
    at new Funnel (node_modules/ember-cli-moment-shim/node_modules/broccoli-funnel/index.js:57:10)
    at Funnel (node_modules/ember-cli-moment-shim/node_modules/broccoli-funnel/index.js:54:43)
    at Class.treeForVendor (node_modules/ember-cli-moment-shim/index.js:146:7)
    at Class._treeFor (node_modules/ember-cli/lib/models/addon.js:557:33)
    at Class.treeFor (node_modules/ember-cli/lib/models/addon.js:517:21)
    at addons.reduce (node_modules/ember-cli/lib/models/addon.js:384:26)
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (node_modules/ember-cli/lib/models/addon.js:381:24)
    at Class.treeFor (node_modules/ember-cli/lib/models/addon.js:516:22)

The error is caused by this.momentNode being undefined in index.js:146

  treeForVendor(vendorTree) {
    let trees = [];
    let options = this._options;

    if (vendorTree) {
      trees.push(vendorTree);
    }

    trees.push(
      funnel(this.momentNode, {
        destDir: 'moment',

When testing this I am getting undefined for both this._options and this.momentNode when checking them outside of included where they are assigned. included is called before treeForVendor. Any ideas what is causing this error ?

jasonmit commented 6 years ago

@noplisu any chance you can push this addon anywhere for me to debug against?

noplisu commented 6 years ago

The error was caused by me using this._super.included(app) in index.js, included of my addon instead of this._super.included.apply(this, arguments);