rwjblue / ember-cli-ic-ajax

MIT License
21 stars 12 forks source link

Cannot read property 'options' of undefined #13

Open vvscode opened 9 years ago

vvscode commented 9 years ago

I've got an error

Cannot read property 'options' of undefined
TypeError: Cannot read property 'options' of undefined
    at Class.module.exports.included (/Users/vvs/repo/apollo-auth/node_modules/ember-cli-ic-ajax/index.js:12:27)
    at /Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/models/addon.js:241:32
    at Array.map (native)
    at Class.eachAddonInvoke (/Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/models/addon.js:239:22)
    at Class.Addon.included (/Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/models/addon.js:345:8)
    at EmberApp.<anonymous> (/Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/broccoli/ember-app.js:312:15)
    at Array.filter (native)
    at EmberApp._notifyAddonIncluded (/Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/broccoli/ember-app.js:307:45)
    at new EmberApp (/Users/vvs/repo/apollo-auth/node_modules/ember-cli/lib/broccoli/ember-app.js:103:8)
    at Object.<anonymous> (/Users/vvs/repo/apollo-auth/Brocfile.js:10:11)

ember -v shows

version: 0.2.7
node: 2.2.1
npm: 2.11.0

package.json contains:

  "devDependencies": {
    "broccoli-asset-rev": "2.0.0",
    "broccoli-merge-trees": "0.1.4",
    "broccoli-static-compiler": "0.1.4",
    "broccoli-ember-hbs-template-compiler": "1.6.1",
    "ember-cli-6to5": "0.2.1",
    "ember-cli-accounting": "0.0.4",
    "ember-cli-bootstrap": "0.0.15",
    "ember-cli-dependency-checker": "0.0.7",
    "ember-cli-inject-live-reload": "1.3.0",
    "ember-cli-less": "1.0.4",
    "ember-cli-qunit": "0.1.2",
    "ember-data": "1.0.0-beta.12",
    "ember-export-application-global": "1.0.0",
    "ember-validations": "2.0.0-alpha.1",
    "express": "4.8.5",
    "glob": "4.0.5"
  },
  "dependencies": {
    "ember-cli": "^0.2.7",
    "ember-cli-ic-ajax": "^0.2.1"
  }
kaytee821 commented 8 years ago

I got the same error inside the terminal on start up and it seemed the only thing that fixed it was to move my ember-cli-ic-ajax reference to the devDependencies object.

This seems backwards to me since npm documentation states that devDependencies should contain references to packages specific to development environments (https://docs.npmjs.com/files/package.json#devdependencies).

Hopefully this helps or someone else can explain why this worked.