Aurelia - getting TypeError: palModule.initialize is not a function

Aurelia - getting TypeError: palModule.initialize is not a function

尝试使用 ASP.NET Core 设置我的第一个 Aurelia Hello World 项目。无法克服上述错误。

3 个文件,index.html,app.html,app.js:

Index.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body aurelia-app>
    <script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
    <script>
        System.import("aurelia-bootstrapper");
    </script>
</body>
</html>

app.html:

<template>
    <div>${message}</div>
</template>

app.js:

export class App {
    constructor() {
        this.message = "Hello from Aurelia";
    }
}

ASP.NET核心StartUp.cs:

    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.Run(async (context) =>
            {
                //await context.Response.WriteAsync("Hello World!");
            });
        }
    }
}

否则一切正常。 运行 安装 Aurelia 的以下命令:

jspm install aurelia-framework
jspm install aurelia-bootstrapper

非常基本但出现错误: Error:

我认为您需要 运行 aurelia-pal-browser 因为这将使我们能够 运行 不同环境中的框架。

试试这个代码:

jspm install npm:aurelia-pal-browser