{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3357","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3357/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3357/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3357/events","html_url":"https://github.com/ember-cli/ember-cli/issues/3357","id":58769521,"number":3357,"title":"A flag to disable registering generated routes with the router?","user":{"login":"misteroneill","id":214723,"avatar_url":"https://avatars.githubusercontent.com/u/214723?v=3","gravatar_id":"","url":"https://api.github.com/users/misteroneill","html_url":"https://github.com/misteroneill","followers_url":"https://api.github.com/users/misteroneill/followers","following_url":"https://api.github.com/users/misteroneill/following{/other_user}","gists_url":"https://api.github.com/users/misteroneill/gists{/gist_id}","starred_url":"https://api.github.com/users/misteroneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misteroneill/subscriptions","organizations_url":"https://api.github.com/users/misteroneill/orgs","repos_url":"https://api.github.com/users/misteroneill/repos","events_url":"https://api.github.com/users/misteroneill/events{/privacy}","received_events_url":"https://api.github.com/users/misteroneill/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/discussion","name":"discussion","color":"009800"},{"url":"https://api.github.com/repos/ember-cli/ember-cli/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"abuiles","id":21772,"avatar_url":"https://avatars.githubusercontent.com/u/21772?v=3","gravatar_id":"","url":"https://api.github.com/users/abuiles","html_url":"https://github.com/abuiles","followers_url":"https://api.github.com/users/abuiles/followers","following_url":"https://api.github.com/users/abuiles/following{/other_user}","gists_url":"https://api.github.com/users/abuiles/gists{/gist_id}","starred_url":"https://api.github.com/users/abuiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abuiles/subscriptions","organizations_url":"https://api.github.com/users/abuiles/orgs","repos_url":"https://api.github.com/users/abuiles/repos","events_url":"https://api.github.com/users/abuiles/events{/privacy}","received_events_url":"https://api.github.com/users/abuiles/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-02-24T17:09:55Z","updated_at":"2015-03-04T19:59:20Z","closed_at":null,"body":"Our application makes use of an internally-defined set of feature flags, which are set in configuration. Certain routes in the router are only included in the presence of these feature flags:\r\n\r\n```javascript\r\nRouter.map(function () {\r\n  if (features.foo) {\r\n    this.route('foos', function () {\r\n      // etc...\r\n    });\r\n  }\r\n});\r\n```\r\n\r\nThis works great for our purposes - being able to turn on/off entire sections of the application and develop features without exposing them (purposefully or accidentally) to users in production.\r\n\r\nBut it causes the generator (e.g. `ember g route bar`) to fail:\r\n\r\n```\r\ninstalling\r\n  create app/routes/bar.js\r\n  create app/templates/bar.hbs\r\nCannot read property 'arguments' of undefined\r\nTypeError: Cannot read property 'arguments' of undefined\r\n    at hasRoute (/path/to/project/node_modules/ember-cli/node_modules/ember-router-generator/lib/helpers/has-route.js:7:25)\r\n    at EmberRouterGenerator._remove (/path/to/project/node_modules/ember-cli/node_modules/ember-router-generator/lib/ember-router-generator.js:138:18)\r\n    at EmberRouterGenerator.remove (/path/to/project/node_modules/ember-cli/node_modules/ember-router-generator/lib/ember-router-generator.js:119:33)\r\n    at removeRouteFromRouter (/path/to/project/node_modules/ember-cli/blueprints/route/index.js:99:26)\r\n    at Class.module.exports.afterUninstall (/path/to/project/node_modules/ember-cli/blueprints/route/index.js:86:7)\r\n    at $$$internal$$tryCatch (/path/to/project/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:490:16)\r\n    at $$$internal$$invokeCallback (/path/to/project/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:502:17)\r\n    at $$$internal$$publish (/path/to/project/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:473:11)\r\n    at Object.$$rsvp$asap$$flush [as _onImmediate] (/path/to/project/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1581:9)\r\n    at processImmediate [as _immediateCallback] (timers.js:345:15)\r\n```\r\n\r\nThis seems to be coming from [ember-router-generator](https://github.com/ember-cli/ember-router-generator), but thought I'd raise it here as it might get more eyes.\r\n\r\nThis unlikely to be a condition ember-cli/ember-router-generator wants to concern itself with, but it might make sense to have a command line flag to disable registering the generated route with the router: `ember g route bar --no-register` or something."},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/77234131","html_url":"https://github.com/ember-cli/ember-cli/issues/3357#issuecomment-77234131","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3357","id":77234131,"user":{"login":"abuiles","id":21772,"avatar_url":"https://avatars.githubusercontent.com/u/21772?v=3","gravatar_id":"","url":"https://api.github.com/users/abuiles","html_url":"https://github.com/abuiles","followers_url":"https://api.github.com/users/abuiles/followers","following_url":"https://api.github.com/users/abuiles/following{/other_user}","gists_url":"https://api.github.com/users/abuiles/gists{/gist_id}","starred_url":"https://api.github.com/users/abuiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abuiles/subscriptions","organizations_url":"https://api.github.com/users/abuiles/orgs","repos_url":"https://api.github.com/users/abuiles/repos","events_url":"https://api.github.com/users/abuiles/events{/privacy}","received_events_url":"https://api.github.com/users/abuiles/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T19:59:20Z","updated_at":"2015-03-04T19:59:20Z","body":"I just release ember-router-generator@0.3.2 so this shouldn't fail any more, we might still add a rescue in case someone is doing crazy stuff in their router."}}