0
votes

I'm trying to follow this example of how to use aurelia in a multiple page application.

http://patrickwalters.net/creating-multipage-apps-using-aurelia-2/

When i do

  aurelia.start().then(a => {
    let start = 'app'
    a.setRoot(start);
  });

i receive the following error:

Unable to find module with ID: app

  • I already made this work with require. Maybe a thing with webpack?
  • In the example 'start' receive a string from body element, i just want to make it easy to follow
1

1 Answers

0
votes

Webpack requires you to use PLATFORM.moduleName to declare your modulenames, see the docs: https://github.com/aurelia/webpack-plugin/wiki/Managing-dependencies

So you would need to write

import { PLATFORM } from "aurelia-pal";
...

aurelia.start().then(a => {
    let start = PLATFORM.moduleName('app');
    a.setRoot(start);
  });