Upgrading to Aurelia Router 1.5

Looking to upgrading to Router 1.5 for a Net Core project and followed the instructions in https://aurelia.io/blog/2018/01/22/big-changes-in-the-aurelia-router-150-release/. The project builds fine but fails with an unexpected run time error detailed below. I cannot see anything wrong with the configuration files. The same error comes up when the Microsoft SPA template is used in a brand new application. Webpack seems to be a common factor since have tried several projects that work fine with the standard router and all give this same error. Can anyone help?


Root cause of this is because PAL module is not run before application code. To fix this, I’m not sure as it depends on application but maybe from the root cause you can work it out

Thanks. I managed to fix it by loading the correct versions of the packages. The numbering is not logical but works. In this case I used the following commands in the VS Package Manager Console:

npm install aurelia-pal-browser@1.2.1
npm install aurelia-templating-resources@1.4.0
npm install aurelia-templating-router@1.1.0

Afraid this is not working properly with Net Core since attempts to use null moduleIds in a viewport don’t work. Why is this? See example below:


The App.ts is as follows (if the null moduleId is changed to a non null it works OK)

If anyone is interested the App.ts code was used in a brand new Aurelia-CLI project (automatically loading Aurelia Router 1.5) and RequireJS rather than Webpack and all works fine. Setting a viewport moduleId is OK. Whilst investigating one problem I have found another.

The two routes have respectively 2 and 3 viewports. This is OK for default route which displays correctly. However clicking the Test2 navigation should display three but only shows two viewports. Clicking the reload button in browser then shows the three viewports.