Ionic 4 运行 浏览器加载资源失败

Ionic 4 run browser failed to load resource

我用 ionic start test sidemenu --type=angular 创建了一个名为 "test" 的简单 Ionic 4 sidemenu 应用程序。

然后,在不做任何更改的情况下,我 运行 ionic cordova run browser 并自动打开浏览器并且一切正常。

问题是,如果我尝试直接在浏览器中打开 /platforms/browser/www/index.html 文件,则会出现黑页和文件错误 failed to load resourcesruntime.js, polyfills.js, styles.js, cordova.js, vendor.js, vendor.js

如果我 运行 ionic cordova run browser --prod 相同的行为。

使用 ionic 3 我没有错误。

加载资源失败:

我的 Ionic 信息是:

Ionic:

   ionic (Ionic CLI)             : 4.2.1 (/usr/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.13
   @angular-devkit/build-angular : 0.8.6
   @angular-devkit/schematics    : 0.8.6
   @angular/cli                  : 6.2.6
   @ionic/angular-toolkit        : 1.0.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/losciur/Android/Sdk)
   NodeJS            : v8.12.0 (/usr/bin/node)
   npm               : 6.4.1
   OS                : Linux 4.8

index.html中添加<base href="." />删除<base href="/" />.