TypeError: Cannot read property 'router' of undefined
See original GitHub issueHello, I just had this error while trying to configure my engine. I just have one route in my addon:
import buildRoutes from 'ember-engines/routes';
export default buildRoutes(function() {
this.route('myRoute');
});
In my app/router.js
this.mount('myAddon');
I received this error, when I tried to access to this route via _http://localhost:4200/myAddon/myRoute_:
TypeError: Cannot read property 'router' of undefined
at error (router.js:827)
at Router$1.triggerEvent (router.js:1006)
at trigger (router.js:111)
at Transition.trigger (router.js:645)
at router.js:456
at tryCatch (rsvp.js:429)
at invokeCallback (rsvp.js:444)
at publish (rsvp.js:412)
at publishRejection (rsvp.js:347)
at rsvp.js:14
Maybe somebody already faced this error, I couldn find any information on SO or github, but maybe I missed something!
If you need more information, please ask me! Good day to you!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Cannot read property 'router' of undefined · Issue #380 - GitHub
Hi, I have an issue with routing when i want to use the stateService to navigate. In the project i use version 0.8.9....
Read more >Cannot read property '$router' of undefined? - Stack Overflow
I'm trying make so that users can login to page, but is showing me this massage "Cannot read property '$router' of undefined".
Read more >typeerror: cannot read properties of undefined (reading 'router')
Here's an example of a JavaScript TypeError: Cannot read property of undefined thrown when a property is attempted to be read on an...
Read more >Cannot read properties of undefined (reading 'pathname')
The error "Cannot read properties of undefined (reading 'pathname')" occurs when we don't set the to prop on a Link component in React...
Read more >getting "TypeError: Cannot read property 'quote' of undefined ...
const express = require('express'); const { process_params } = require('express/lib/router'); const app = express(); const records ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just done some research. Issue appear when adding
ember-simple-auth
addon. Prepared test project to reproduce an issue. You can download it here https://www.dropbox.com/s/ikjlltvw40sr4oi/bug_test.tar.gz?dl=0 Engines route protected withember-simple-auth
mixin and it caused an issue. To see it go to http://localhost:4200/blog/ Engine’s route without simeple auth mixin work well.May be issue not in engines, but in simple-auth. But I hope at least you can check it and give a reasonable reply or may be point me what I am doing wrong.
I submitted https://github.com/emberjs/ember.js/pull/15665 to address the specific issue reported here (the
'router' of undefined
error).