Skip to content

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

Merged
kimroen merged 1 commit intokimroen:masterfrom
perlun:patch-1
Aug 5, 2015
Merged

Fix for issue with recent versions of ember-cli (Cannot read property 'dummy' of undefined)#88
kimroen merged 1 commit intokimroen:masterfrom
perlun:patch-1

Conversation

@perlun
Copy link
Contributor

@perlun perlun commented Aug 4, 2015

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)

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
Copy link

richmolj commented Aug 5, 2015

Big 👍 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
Copy link

richmolj commented Aug 5, 2015

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

@kimroen
Copy link
Owner

kimroen commented Aug 5, 2015

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

kimroen added a commit that referenced this pull request Aug 5, 2015
Fix for issue with recent versions of ember-cli (Cannot read property 'dummy' of undefined)
@kimroen kimroen merged commit b74defd into kimroen:master Aug 5, 2015
@kimroen
Copy link
Owner

kimroen commented Aug 6, 2015

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

@perlun
Copy link
Contributor Author

perlun commented Aug 6, 2015

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

@perlun perlun deleted the patch-1 branch August 6, 2015 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants