# \[Au2\] Is anyone using router (not lite) in production?

**URL:** <https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329>\
**Category:** Uncategorized\
**Created:** [January 17, 2025, 2:20pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329 "2025-01-17T14:20:12Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [January 17, 2025, 2:20pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/1 "2025-01-17T14:20:12Z")

</div>

Hi, after some initial doubts I’ve chosen au2 for a new project that started almost a year ago.  
While the overall experience is surprisingly smooth (well, not that surprisingly after all, given how stable was au1), we’re worried about the router.  
First of all, there are some major issues with `load` attribute - it basically doesn’t work even in the most basic scenario. I’ve filled the bug report, it’s been [confirmed almost a year ago](https://github.com/aurelia/aurelia/issues/1902#issuecomment-2001918986) but is still not resolved.  
Second, we’re experiencing some strange issues in the edge cases (very hard to reproduce) where the content of new route is rendered, but the old one is not removed yet - we end up having two views stacked together.

This makes me wonder whether anyone here uses the router (again, not lite) in the production?  
Or is the router-lite a better way to go? We could probably plan switching the router if that is more stable; giving up a little of modularity for the stability of the solution

please advise 🙂

---

<div class="post-metadata">

**Author:** ![dwaynecharrington](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/dwaynecharrington/32/11_2.png) [@dwaynecharrington](https://discourse.aurelia.io/u/dwaynecharrington)\
**Post date:** [January 19, 2025, 1:22pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/2 "2025-01-19T13:22:34Z")

</div>

I use the `router-lite` package for my routing needs as I don’t use any of the direct routing functionality or other features that come in the core `@aurelia/router` package. The `@aurelia/router-lite` router gets you functionality that is more akin to v1 routing or routing in other frameworks/libraries.

I can’t speak for the aforementioned issues, but I do know that the lite router is in good shape and there is a good chance you were probably not using direct routing anyways.

---

<div class="post-metadata">

**Author:** ![jwx](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jwx/32/507_2.png) [@jwx](https://discourse.aurelia.io/u/jwx)\
**Post date:** [January 19, 2025, 3:00pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/3 "2025-01-19T15:00:53Z")

</div>

I know of several projects that use the router successfully. As far as I know, the issues you’ve mentioned are resolved, but I’ll try and find some time this upcoming week to verify that.

---

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [January 27, 2025, 11:41am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/4 "2025-01-27T11:41:23Z")

</div>

@dwaynecharrington thanks for the input on the router-lite. Will see how it goes with the `router` but either way it’s good to know there’s a safe plan B 🙂

@jwx thank you, looking forward to it.  
I’m afraid the duplicated content is still there, I’ve seen it myself one or two times in our app in the recent days, I’ll try to prioritize the investigation into it to provide you with a repro.  
as for the other issue ( [Router load attribute: broken when using id & parameters.bind · Issue #1902 · aurelia/aurelia · GitHub](https://github.com/aurelia/aurelia/issues/1902) ) I’ve updated the repro code to use the beta 23 and the bug is still there.

You can check yourself here - [Aurelia Recipes Completed (forked) - StackBlitz](https://stackblitz.com/edit/au2-conventions-ptqpuz)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/3/3199d5e0584511ed2182c257c20685d99e692d42.png)

---

<div class="post-metadata">

**Author:** ![mroeling](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mroeling/32/781_2.png) [@mroeling](https://discourse.aurelia.io/u/mroeling)\
**Post date:** [January 28, 2025, 10:13pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/5 "2025-01-28T22:13:42Z")

</div>

TL:DR 😅 Sorry @migajek no solution found yet, but a rather extended analysis of the route handling that caused the issue.

Curious to see what was happening, I’ve just started the StackBlitz environment.  
I’ve opened the developer console, and one of the things mentioned is the `load` → `loading` deprecation/advise. It’s mentioned on each followed route.

Next step was to reproduce the error, indeed, simply by clicking one of the recipes. Error was triggered.

I’ve set a breakpoint on the error handling function (createUnresolvedinstructionsError, line 8171 atm) to see the stack.

On first break, like the error mentions, there is one route left to handle.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/1/10fb490ec31020fb08684efc2fd383c66215b72e.png)

And for the stack at that time:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/a/ab73765c418831d51a81bec95a651bd7452110f0.png)

Checking the stack for possible issues, the location of the 100-iterations guard actually contains several TODO’s. @ devs, might be worth checking those?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/5/50227a8402ea39f7064e6b529ab8863465e8cdf7.png)

Right. This initially broke on the error, so let’s see what we can figure out between a few of the do-while runs. 🙂

Set a new breakpoint on the first line within the do-while loop, see previous screenshot for the actual line. Rerunning the application.  
While rerunning, with this breakpoint in place, I noticed that the do-while was ended because `this.matchedInstructions.length` became `0` (as expected).

Now, let’s try the Beef Stroganoff (getting hungry 😛 )

So first thing is to see what `scope` contains. No clue yet where to look… so just a screenshot.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/6/6e1ef513924fad43073d74b2833a651b9c605417.png)  
Interesting part (little more to the bottom), is the routerInstruction. It’s not the same in one of the trees, but slightly different  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/f/f14623b7f5df34d97bc174a4a5c2cda099e1c89b.png)

So let’s see where the loop iteration ends and see what might be causing the issue.

- local var `matchedEndpoints` starts with an empty array.
- `clearEndpoints` is empty as well
- `hooked` is empty array, so `=== false` check fails.
- Trying to step into the else-if actually kills the iframe! Bummer! (reproducable!) Let’s see if info can be retrieved.
- Baking a tart this time. `hooked` is not `true`, and `hooked !== this.matchedInstructions` is `false`. So not going into the else if.
- since `this.matchedInstructions` is `[]`, the for loop is not run.
- `skipping` and `skippingWithMore` are empty arrays too.
- … leading to a quite explicit Todo: `{ // TODO: !!!!!! && !foundRoute.hasRemaining))`  
foundRoute actually is undefined there, so might be “just” a cleanup issue?
- the next part is actually run, because the route is unrestricted (according to data)  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/a/affc0a40227706054fe8e3dbdcf1db427a9afd62.png)
- the `finalEndpoint()` sets `this.hasAllEndpoints` to true, and handles some states  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/f/f7efdfad2a64865ec521c7f62269d5dbe0bfaa23.png)
- `this.run()` → this.entities is empty, `this.running` is set to true
- `this.hasAllEndpoints` = true, so inside if. `guardedUnload` is undefined, so no promise.
- Right, reaching the end of the first iteration. `this.cancelled` is false, no `changedEndpoints`
- Another TODO here!  
`TODO: Use a better solution here (by checking and waiting for relevant viewports`
- `this.matchingInstructions` is still empty, `this.instructions` is not. And ofc `this.running` still true.
- clearEndpoints is an empty array, so no change to this.instructions.
- And last line of the original do-while: changedEndpoints still not containing any data.
- In the `while` check, the `getInstructionsForScope(scope)` still returns the original instruction.

**Conclusion**

Right, reaching a conclusion of this analysis 🙂  
No changes in next iterations - as expected. The instruction is still the same. Guard count ofc decreasing to 0 which in the end will trigger the error.

So, what is causing the actual issue? Some possible culprits:

- this.processedInstructions still empty
- this.matchedInstructions still empty
- since the `setNextContent` is within the `matchedInstructions` for-loop, I think this is where the check actually fails.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/d/d7c3b9f32d7fb94be6132cb119076dd88d4addd3.png)
- with one step earlier, the local const `clearEndpoints` might also be improperly set  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/f/f40c7c4f4b01d2df5e43878a17c07c0cc167e768.png)

Without deep knowledge it is a bit hard to exactly pinpoint, or to find a solution. But I hope this analysis helps a bit.

---

<div class="post-metadata">

**Author:** ![jwx](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jwx/32/507_2.png) [@jwx](https://discourse.aurelia.io/u/jwx)\
**Post date:** [January 28, 2025, 10:36pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/6 "2025-01-28T22:36:37Z")

</div>

Thanks for letting me know and updating the repro! I’ll look into this as soon as possible and report back.

---

<div class="post-metadata">

**Author:** ![jwx](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jwx/32/507_2.png) [@jwx](https://discourse.aurelia.io/u/jwx)\
**Post date:** [January 28, 2025, 10:36pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/7 "2025-01-28T22:36:56Z")

</div>

This is helpful, thanks!

---

<div class="post-metadata">

**Author:** ![mroeling](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/mroeling/32/781_2.png) [@mroeling](https://discourse.aurelia.io/u/mroeling)\
**Post date:** [January 29, 2025, 6:57pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/8 "2025-01-29T18:57:23Z")

</div>

O, btw, you might have noticed already, but I did not do an analysis about the actual calling code. So although I doubt it, it can still be a matter of misconfiguration or perhaps a little road instead of the happy path.

If that is case, the code does need to be made more monkey-proof. So either way changes needed 😉 Looking forward to your changes and opinion.

---

<div class="post-metadata">

**Author:** ![elmt1](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elmt1/32/2687_2.png) [@elmt1](https://discourse.aurelia.io/u/elmt1)\
**Post date:** [February 26, 2025, 6:25pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/9 "2025-02-26T18:25:09Z")

</div>

> Second, we’re experiencing some strange issues in the edge cases (very hard to reproduce) where the content of new route is rendered, but the old one is not removed yet - we end up having two views stacked together.

I have seen this as well, but switched to the router-lite and haven’t seen it happen since.

---

<div class="post-metadata">

**Author:** ![elmt1](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elmt1/32/2687_2.png) [@elmt1](https://discourse.aurelia.io/u/elmt1)\
**Post date:** [February 26, 2025, 6:41pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/10 "2025-02-26T18:41:03Z")

</div>

The Aurelia 2 documentation references direct routing but I couldn’t find anything that defined what it is so I wasn’t sure what it meant other than implying that there was some form of indirect routing.

A deeper search came up with some unlinked documentation on routing that seems to define what it is:  
([Direct Routing | aurelia-direct-router](https://jwx.gitbook.io/aurelia-direct-router/routing/direct-routing))

There is another mention in the source repository docs/user-docs/routing/direct-routing.md, but I don’t actually see this on the [docs.aurelia.io](http://docs.aurelia.io) site

---

<div class="post-metadata">

**Author:** ![MaximBalaganskiy](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/maximbalaganskiy/32/831_2.png) [@MaximBalaganskiy](https://discourse.aurelia.io/u/MaximBalaganskiy)\
**Post date:** [May 12, 2025, 9:47am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/11 "2025-05-12T09:47:41Z")

</div>

Non lite router does seem half baked.

- I second the content duplication.
- Href without hashtags does not work well.
- Navigation drops a default sub route when anchor is clicked

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [May 12, 2025, 4:13pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/12 "2025-05-12T16:13:55Z")

</div>

Hi! I was refraining myself commenting here, as I am using router-lite in production and thus, my opinion on this topic might be very biased. Therefore, I rather wanted to hear the feedback of the community on this topic.

I just want to ask you guys, without wanting to hijack the main thread of discussion, are there any reasons that drive you away from the router-lite? Moreover, are there any scenarios, within the configured routing realm, that are poorly handled by router-lite?

Thank you!

---

<div class="post-metadata">

**Author:** ![elitastic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitastic/32/1787_2.png) [@elitastic](https://discourse.aurelia.io/u/elitastic)\
**Post date:** [May 13, 2025, 8:04am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/13 "2025-05-13T08:04:21Z")

</div>

To be honest, I don’t quite understand why it’s made complicated for beginners by offering two routers that, in my opinion, don’t have entirely happy names. In my opinion, the “Router lite” is a very comprehensive, reliable router that can do everything important apart from direct routing. The “Non lite” router, on the other hand, seems to be immature and offers no added value apart from direct routing. Bugs/issues also appear not to be fixed for a long time in the “non lite” router. Wouldn’t it make more sense, for example, to change the naming to:

- configurable-router / default-router / .. (or similar)
- experimental-direct-router

In my opinion, the aim should be to make it clear to beginners (for the time being) that the “router lite” is currently the better choice.

---

<div class="post-metadata">

**Author:** ![MaximBalaganskiy](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/maximbalaganskiy/32/831_2.png) [@MaximBalaganskiy](https://discourse.aurelia.io/u/MaximBalaganskiy)\
**Post date:** [May 14, 2025, 10:14pm UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/14 "2025-05-14T22:14:43Z")

</div>

No reason except that “lite” is perceived as “with less functionality”. Heavy router should be removed imho

---

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [May 15, 2025, 8:05am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/15 "2025-05-15T08:05:25Z")

</div>

@MaximBalaganskiy , thank you for the input. I’m happy it’s not only me having issues with the router.

@Sayan751 that is a very valid question, not a hijack at all 🙂  
To answer fully - the decision was made (by me) quite a long time ago, but as far as I remember it was something along those lines:

> why would I pick the router- **lite** and possibly regret the limited functionality in the future, when there is no reason to care about the bundle size that much (already lots of heavy deps). Looks like a no-brainer, duh.

After over a year, there was not a single scenario where direct routing could even be considered. So the switch to router-lite is on the roadmap.

I agree with Maxim here - the _lite_ in the name is somewhat repelling, apparently for no good reason actually.

---

<div class="post-metadata">

**Author:** ![simonfox](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/simonfox/32/79_2.png) [@simonfox](https://discourse.aurelia.io/u/simonfox)\
**Post date:** [May 18, 2025, 12:09am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/16 "2025-05-18T00:09:34Z")

</div>

I’ll chime in here as well; I believe `router` should be dropped now before leaving beta. It should be removed completely from the core framework to reduce both confusion for newcomers as well as maintenance requirement for the team.

We’re in the process of migrating a large app to au2 and `router-lite` does everything we need and is familiar coming from au1. @Sayan751 has been incredibly responsive in resolving issues we’ve found and adding functionality that was initially missing.

---

<div class="post-metadata">

**Author:** ![elmt1](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elmt1/32/2687_2.png) [@elmt1](https://discourse.aurelia.io/u/elmt1)\
**Post date:** [May 19, 2025, 8:44am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/17 "2025-05-19T08:44:24Z")

</div>

I had a difficult time deciding whether to use `router` or `router-lite` when converting Aurelia 1 applications. I decided to start with `router-lite` and use it until I reached a limitation that only the `router` could handle. I also thought the navigation model in `router-lite` would help me build my menus. After using it for a while and asking some questions here in this forum, I have a new opinion.

I think `router-lite` will do everything I need, and the navigation model was a distraction. If I could go back in time, I would tell my old self:

1. Don’t worry about the “-lite” in the name.
2. Don’t try to force the navigation model to create a hierarchical menu.
3. Get over using query strings; just use paths.
4. Routes aren’t really routes; they are endpoints.
5. Create links with `href` using `../` + a route’s path.
6. There are two types of hooks: router and lifecycle.
7. Wrap the navigation in a hierarchical structure for menus.

I am sure that I am still missing some key concepts, but if the names had been `router-direct` and `router` instead of `router` and `router-lite`, I would have saved half a day. That assumes that the definition of and examples of [direct routes](https://jwx.gitbook.io/aurelia-direct-router/routing/direct-routing) were readily available.

---

<div class="post-metadata">

**Author:** ![elitastic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitastic/32/1787_2.png) [@elitastic](https://discourse.aurelia.io/u/elitastic)\
**Post date:** [July 15, 2025, 7:46am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/18 "2025-07-15T07:46:28Z")

</div>

Thanks @Sayan751 for your work!

> <https://github.com/aurelia/aurelia/pull/2186>
>
> \# Pull Request
> 
> \## 📖 Description
> 
> 
> 
> \### BREAKING CHANGE 
> 
> The routers ha…ve been renamed. The \`@aurelia/router\` is renamed to \`@aurelia/router-direct\` and the \`@aurelia/router-lite\` is renamed to \`@aurelia/router\`. No change of functionalities have been introduced for either of those routers. Hence, updating to the next version of Aurelia2 would require the following changes.
> 
> \#### For \`@aurelia/router-lite\` users
> 
> \`\`\`diff
> \- import { ... } from '@aurelia/router-lite';
> + import { ... } from '@aurelia/router';
> \`\`\`
> 
> \#### For \`@aurelia/router\` users
> 
> \`\`\`diff
> \- import { ... } from '@aurelia/router';
> + import { ... } from '@aurelia/router-direct';
> \`\`\`
> 
> \### 🎫 Issues
> 
> 
> 
> \## 👩‍💻 Reviewer Notes
> 
> 
> 
> \- The docs are updated as well.
> \- The two failing pipeline tasks, involving working with git merge, should be understandable. Not sure how to "fix" those or if it is necessary.
> 
> \## 📑 Test Plan
> 
> 
> 
> \## ⏭ Next Steps

---

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [July 16, 2025, 7:40am UTC](https://discourse.aurelia.io/t/au2-is-anyone-using-router-not-lite-in-production/6329/19 "2025-07-16T07:40:20Z")

</div>

Follow up for anyone interested - for the next project we chose router-lite and so far we are happy with it.  
It just works as expected, making it in pair with the rest of Aurelia 2. I’m glad to see it becoming a “default” router.
