Using require breaks router...?

I tried to do this more simply but I am not sure how to set versions with gist so I made a simple project. To keep it similar to my project I used a fork based on a dotnet core/webpack setup by @MaximBalaganskiy. You can download from git. Just run the following to see it work:

git clone -b aurelia-template-error https://github.com/elmt1/AureliaDotnetTemplate.git
npm install
dotnet build
dotnet run

You should see the text “home” on the page that is pulled in using a terminology value-converter. It should display “Home”.

To see it fail, delete the package-lock.json, node-modules directory and change the aurelia-templating to 1.8.2 in the package.json and run the commands above again. If you navigate away from the home page and come back it will work.

There are many ways to accomplish what this value converter is doing, so a work-around/better way might be the answer. However, the way I did this was simple and made sense to me. In my real applications a locale selection is defined in app.html and that feeds into the navigation and the rest of the application so defining and sharing the locale and terminology array in app.ts seemed OK.

1 Like