Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
aurelia plugin.load不是函数错误_Aurelia - Fatal编程技术网

aurelia plugin.load不是函数错误

aurelia plugin.load不是函数错误,aurelia,Aurelia,我第一次尝试运行aurelia cli。除了路由器视图,我的一切都正常工作。我一直在犯错误 Uncaught TypeError: plugin.load is not a function at Module... 这是我的档案: main.js import environment from './environment'; //Configure Bluebird Promises. Promise.config({ warnings: { wForgottenReturn

我第一次尝试运行aurelia cli。除了路由器视图,我的一切都正常工作。我一直在犯错误

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());
}
export class App {
  configureRouter(config, router){
    this.router = router;
    config.title = 'Aurelia';
    config.map([
      { route: '', name: 'default', moduleId: 'default', nav: false, title: 'Default' }
    ]);
  }
}
export class DefaultApp {
    constructor(){
        this.test = 'TEST!';
    }
}
app.html

<template>
  <require from="bootstrap/css/bootstrap.css"></require>
  <router-view></router-view>
</template>
<template>
    ${test}
</template>
<!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>
default.html

<template>
  <require from="bootstrap/css/bootstrap.css"></require>
  <router-view></router-view>
</template>
<template>
    ${test}
</template>
<!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>
index.html

<template>
  <require from="bootstrap/css/bootstrap.css"></require>
  <router-view></router-view>
</template>
<template>
    ${test}
</template>
<!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>

奥雷利亚

你知道我为什么一直出现这个错误吗?

我遇到的问题是,我把default.html文件放在一个文件夹中,而不是放在default.js旁边。移动后,一切正常。

请发布index.html.updated以包含index.htmlIssue,请参见下文