我用ionic start test sidemenu --type=angular
创建了一个简单的Ionic 4侧菜单应用程序,称为“测试”。
然后,不做任何更改,我运行ionic cordova run browser
,并自动打开浏览器,一切正常,很好。
问题是,如果我尝试直接在浏览器中打开/platforms/browser/www/index.html
文件,则出现黑页,并且文件出现failed to load resources
错误:runtime.js, polyfills.js, styles.js, cordova.js, vendor.js, vendor.js
。
如果运行ionic cordova run browser --prod
,则行为相同。
使用ionic 3,我没有错误。
无法加载资源:
我的离子信息是:
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
添加 <base href="." />
在index.html和删除 <base href="/" />
中。