Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Is it possible to support routable engines? #100

Open
Cryrivers opened this issue Nov 11, 2016 · 5 comments
Open

Is it possible to support routable engines? #100

Cryrivers opened this issue Nov 11, 2016 · 5 comments

Comments

@Cryrivers
Copy link

No description provided.

@dguettler
Copy link
Collaborator

What are the issues you're seeing when trying to use it in combination with routable engines?

@mrkirchner
Copy link

What i am seeing is the following error

Assertion Failed: [ember-crumbly] Could not find a current route Error at assert (http://localhost:4200/assets/vendor.js:20974:13) at assert (http://localhost:4200/assets/vendor.js:32725:34) at Class.get (http://localhost:4200/engines-dist/authoring/assets/engine-vendor.js:5072:9) at ComputedPropertyPrototype.get (http://localhost:4200/assets/vendor.js:32381:28) at Object.get (http://localhost:4200/assets/vendor.js:37374:19) at RootPropertyReference.compute (http://localhost:4200/assets/vendor.js:30337:26) at RootPropertyReference.value (http://localhost:4200/assets/vendor.js:30204:45) at ArrayIterable.iterate (http://localhost:4200/assets/vendor.js:29960:26) at IterationArtifacts.isEmpty (http://localhost:4200/assets/vendor.js:59895:58) at IterablePresenceReference.value (http://localhost:4200/assets/vendor.js:64296:36)

Ill try to dig a bit more to get some more information.

@mrkirchner
Copy link

mrkirchner commented Apr 12, 2017

Looks like in bread-crumbs.js

currentRouteName: readOnly('applicationRoute.controller.currentRouteName'),

currentRouteName is undefined since controller is pretty much empty. This described case is where I have put crumbly inside a component within my Ember Engine.

If i try to move the breadcrumb to the parent applications i get:

[ember-crumbly] route:authoring was not found Error at assert (http://localhost:4200/assets/vendor.js:20974:13) at assert (http://localhost:4200/assets/vendor.js:32725:34) at http://localhost:4200/engines-dist/authoring/assets/engine-vendor.js:5134:9 at Array.map (native) at Class._lookupBreadCrumb (http://localhost:4200/engines-dist/authoring/assets/engine-vendor.js:5126:44) at Class.get (http://localhost:4200/engines-dist/authoring/assets/engine-vendor.js:5076:27) at ComputedPropertyPrototype.get (http://localhost:4200/assets/vendor.js:32381:28) at Object.get (http://localhost:4200/assets/vendor.js:37374:19) at RootPropertyReference.compute (http://localhost:4200/assets/vendor.js:30337:26) at RootPropertyReference.value (http://localhost:4200/assets/vendor.js:30204:45)

Hopefully that give you enough info to try to fix it. If you need me to do anything let me know.
@dguettler

@ascudder
Copy link

ascudder commented Jun 23, 2017

I encountered this same problem with one of our projects, so think I found where this issue is coming from.

In the _lookupRoute function in the bread-crumbs component, the getOwner(this) function can only look up the routes that exist in the parent application. So, when it encounters a route that is inside of a routable engine, _lookupRoute returns undefined because it can't find the route because the route is owned by the engine, not the parent application that's hosting the engine.

After looking at how Ember Engines modified the internal router service for Ember, I believe that using the routing service and the getHandler(routeName) function will allow the route object to get looked up whether the route belongs to the parent app or an engine. I'm starting to work on a PR now that will hopefully help resolve this.

@GCheung55
Copy link

@dguettler with #143 merged, what are the next steps to publishing a new version to NPM?

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

No branches or pull requests

5 participants