kimroen / ember-cli-coffeescript

Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
MIT License
72 stars 49 forks source link

Fix for issue with recent versions of ember-cli (Cannot read property 'dummy' of undefined) #88

Closed perlun closed 9 years ago

perlun commented 9 years ago

With the most recent versions of ember-cli, you get exceptions like this when doing ember destroy route or ember generate route.

$ ember destroy route foo
version: 1.13.6
Could not find watchman, falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
uninstalling route
  remove app/routes/foo.coffee
  remove app/templates/foo.hbs
Cannot read property 'dummy' of undefined
TypeError: Cannot read property 'dummy' of undefined
  at Class.module.exports.shouldTouchRouter (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli/blueprints/route/index.js:66:28)
  at Class.module.exports.shouldTouchRouter (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli-coffeescript/blueprints/route/index.js:31:42)
  at Class.module.exports.shouldTouchRouter (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli-coffeescript/blueprints/route/index.js:31:42)
  at Class.module.exports.afterUninstall (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli-coffeescript/blueprints/route/index.js:52:14)

  at lib$rsvp$$internal$$tryCatch (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:493:16)
  at lib$rsvp$$internal$$invokeCallback (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:505:17)
  at lib$rsvp$$internal$$publish (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:476:11)
  at lib$rsvp$asap$$flush (/Users/plundberg/tmp/ember-cli-test/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
  at process._tickCallback (node.js:355:11)

The problem was that shouldTouchRouter now assumes that it will get the options object passed in as a parameter. This commit fixes this. (thanks to @mriska for helping me out to nail this one down)

richmolj commented 9 years ago

Big :+1: was struggling with this yesterday and thought it was my local setup. Good to walk in today and see a well-written explanation and PR!

richmolj commented 9 years ago

(and just FWIW I applied this fix locally and verified both generate and destroy are fixed.)

kimroen commented 9 years ago

Thank you very much for looking in to and finding the time to work this one out!

kimroen commented 9 years ago

Thanks again - this has now been released with version 1.13.0, along with updates to all the blueprints. Sorry about the wait.

perlun commented 9 years ago

Well, I kind of had to look into it to avoid errors when running ember generate. :wink: But thanks! Great to have a new version out.