Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message: routeHandler.get is not a function #1173

Closed
siva-sundar opened this issue Apr 17, 2020 · 11 comments · Fixed by #1445
Closed

Error message: routeHandler.get is not a function #1173

siva-sundar opened this issue Apr 17, 2020 · 11 comments · Fixed by #1445
Labels

Comments

@siva-sundar
Copy link

Describe the bug

Getting the following error while switching to the Routes tab of the inspector. No data is being shown on the Routes tab due to this error.

To Reproduce
Steps to reproduce the behavior:

  1. Open Ember inspector
  2. Click on Routes
  3. See the error routeHandler.get is not a function on the console.

Screenshots
image

image

Environment
Ember version: 3.4.8
Browser: Chrome 80.0.3987.163

@RobbieTheWagner
Copy link
Member

The relevant code for this is here

routeHandler = routerLib.getHandler(handler);

@chancancode @pzuraq any reason why getHandler would be giving back a result that does not have a get method?

@VasylMarchuk
Copy link

I have this issue as well, and I thought it might be related to using ember-engines

Знімок екрана 2020-04-23 о 23 10 05

@RobbieTheWagner
Copy link
Member

@siva-sundar are you using engines as well?

@siva-sundar
Copy link
Author

@rwwagner90 Yes

@siva-sundar
Copy link
Author

The issue is that the routes tab will try to list all the route instances. But we are getting this error while trying to list the routes of an engine which is not mounted.

@siva-sundar
Copy link
Author

The possible solution would be to lazily list the routes of engine once its mounted.

@RobbieTheWagner
Copy link
Member

@siva-sundar I do not know anything about engines, but if you have a fix in mind, we would welcome a PR to make this work! There is a lot to do to support engines in general, and we would love help from someone who uses them and knows about them.

@steventsao
Copy link
Contributor

Supporting engines would resolve this issue. #632

routeHandler.get is not a function errors because routeHandler is an unresolved Promise.

@RobbieTheWagner
Copy link
Member

I don't know how to support engines. There was a spike by @cyril-sf at one point, but I don't think we ever got anything over the finish line. @chancancode I would be happy to pair with someone on engines support, I just have no idea how to make things work myself.

@cyril-sf
Copy link
Contributor

@rwwagner90 Sorry for never finishing the feature. You can find my code (at least when I stopped) here : cyril-sf@ff5f266

@RobbieTheWagner
Copy link
Member

Thanks @cyril-sf! @chancancode do we have an idea of what engines support should look like? If I have a goal in mind, perhaps I can build on the work Cyril did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants