# Router and enhance problem

**URL:** <https://discourse.aurelia.io/t/router-and-enhance-problem/5390>\
**Category:** Help Requests\
**Created:** [March 21, 2024, 6:43pm UTC](https://discourse.aurelia.io/t/router-and-enhance-problem/5390 "2024-03-21T18:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dspublic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/dspublic/32/1327_2.png) [@dspublic](https://discourse.aurelia.io/u/dspublic)\
**Post date:** [March 21, 2024, 6:43pm UTC](https://discourse.aurelia.io/t/router-and-enhance-problem/5390/1 "2024-03-21T18:43:43Z")

</div>

The example below doesn’t work since beta.12. It gives “The router is already started” exception. (It works fine before Beta.12). How to solve the issue? Any help would be appreciated.

```auto
import { IAurelia } from 'aurelia';
 
export class AboutPage {
  static inject = [IAurelia];

  items = [1, 2, 3];

  constructor(aurelia) {
    this.au = aurelia;
  }

  attached() {
    const itemList = document.getElementById('my-container');
    itemList.innerHTML = "<div repeat.for='item of items'>${item}</div>";
    this.au.enhance({component: { items: this.items }, host: itemList});
  }
}
```

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [March 22, 2024, 9:48am UTC](https://discourse.aurelia.io/t/router-and-enhance-problem/5390/2 "2024-03-22T09:48:24Z")

</div>

it’s an issue with unintentional discovery of app tasks when calling enhance. A similar issue reported here [feat(enhance): call app tasks with `.enhance` API by bigopon · Pull Request #1916 · aurelia/aurelia · GitHub](https://github.com/aurelia/aurelia/pull/1916#issuecomment-1985034744)

You can apply the work around for now, and it’ll be fixed in beta 14.

---

<div class="post-metadata">

**Author:** ![dspublic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/dspublic/32/1327_2.png) [@dspublic](https://discourse.aurelia.io/u/dspublic)\
**Post date:** [March 22, 2024, 6:07pm UTC](https://discourse.aurelia.io/t/router-and-enhance-problem/5390/3 "2024-03-22T18:07:05Z")

</div>

Thank you for your information. Glad to hear this is a known issue. I’m wating for fix.
