Router and enhance problem

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.

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});
  }
}

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

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

1 Like

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