question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading routes in routable engine don't work

See original GitHub issue

Loading subroutes are not working for me in a routeable engine.

My setup: ember@2.8.0 ember-engines@0.3.0 ember-cli@2.7.0

My engine is setup as an in-repo routeable engine. Basically, it seems that all loading subroutes simply aren’t ever entered. Instead, it always falls back to the host apps loading routes.

Steps to reproduce:

ember g route test-subroutes -ir=my-engine
ember g route test-subroutes-loading -ir=my-engine
ember g route loading -ir=my-engine
// lib/my-engine/addon/test-subroutes/route.js

beforeModel() {
  return new Ember.RSVP.Promise((resolve) => {
    Ember.run.later(this, resolve, 5000);
  });
}
{{! lib/my-engine/addon/loading/template.hbs}}
{{! & lib/my-engine/addon/test-subroutes-loading/template.hbs }}

{{log 'engine loading'}}

Basically, the log from the loading templates is never reached. Instead, when looking at the Ember Inspector, I see that while loading, the current route is application.loading.

My host-apps router:

Router.map(function() {
  this.mount('my-engine', { as: 'my-engine' });
});

My engines router:

export default buildRoutes(function() {
  this.route('test-subroutes');
});

( I left out other routes from my app, but I don’t think they should have any impact on this?)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mydeacommented, Nov 7, 2016

This is great! I’m running ember beta & ember-engines 0.4.2 and it’s working perfectly. Thanks for that, that was the only remaining major pain point with engines for us.

2reactions
trentmwilliscommented, Oct 28, 2016

This should be fixed once https://github.com/dgeb/ember-engines/pull/246 and https://github.com/emberjs/ember.js/pull/14545 land. This was honestly, stupidly hard to fix lol.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested routes in ember engine routes.js? - Stack Overflow
Its not rendering the content for comments template. But it doesn't show any error either. ember.js · ember-engines.
Read more >
ember-engines - npm
Routable engines which can be mounted at specific routes in a routing map, and which can contain routes of their own. Route-less engines,...
Read more >
Route Created on Computer Not Following Road or Trail on ...
If it is a non-mapping device, it will not support automatic routing as it does not support mapping products. · If the device...
Read more >
Pros & Cons Of Ember Engines - Medium
When I started working on our team's massive Ember app with more ... The rest of the Engine can be loaded when a...
Read more >
Composability System · Backstage Software Catalog and ...
Routable extensions even enforce lazy loading, as it is the only way to provide a component: ... For example, the following app code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found