2017-02-19 14 views
2

Я пытаюсь запустить aurelia cli в первый раз. У меня все работает, кроме просмотра маршрутизатора. Я получаю ошибкуaurelia plugin.load не является функцией ошибки

Uncaught TypeError: plugin.load is not a function 
at Module... 

вот мои файлы:

main.js

import environment from './environment'; 

//Configure Bluebird Promises. 
Promise.config({ 
    warnings: { 
    wForgottenReturn: false 
    } 
}); 

export function configure(aurelia) { 
    aurelia.use 
    .standardConfiguration() 
    .feature('resources'); 

    if (environment.debug) { 
    aurelia.use.developmentLogging(); 
    } 

    if (environment.testing) { 
    aurelia.use.plugin('aurelia-testing'); 
    } 

    aurelia.start().then(() => aurelia.setRoot()); 
} 

app.html

<template> 
    <require from="bootstrap/css/bootstrap.css"></require> 
    <router-view></router-view> 
</template> 

app.js

export class App { 
    configureRouter(config, router){ 
    this.router = router; 
    config.title = 'Aurelia'; 
    config.map([ 
     { route: '', name: 'default', moduleId: 'default', nav: false, title: 'Default' } 
    ]); 
    } 
} 

default.html

<template> 
    ${test} 
</template> 

default.js

export class DefaultApp { 
    constructor(){ 
     this.test = 'TEST!'; 
    } 
} 

index.html

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Aurelia</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    </head> 

    <body aurelia-app="main"> 
    <script src="scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script> 
    </body> 
</html> 

Любые идеи относительно того, почему я продолжаю получать эту ошибку?

+0

Пожалуйста, разместите свой index.html. –

+0

обновлен, чтобы включить index.html – seroth

+0

Проблема устранена, см. Ниже – seroth

ответ

1

Проблема была в том, что у меня был файл default.html внутри папки, а не рядом с default.js. После того, как он переехал, все сработало.