losciur
losciur

Reputation: 63

Ionic 4 run browser failed to load resource

I created an easy Ionic 4 sidemenu app called "test" with ionic start test sidemenu --type=angular.

Then, without change anything, I run ionic cordova run browser and automatically it opens the browser and all works and is good.

The problem is if I try to open the /platforms/browser/www/index.html file directly in a browser, then I get a black page and the error failed to load resources for the files: runtime.js, polyfills.js, styles.js, cordova.js, vendor.js, vendor.js.

Same behavior if I run ionic cordova run browser --prod.

With ionic 3 I didn't have errors.

Failed to load resources:

enter image description here

My Ionic info is:

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

Upvotes: 0

Views: 2522

Answers (1)

Aravind Sarikonda
Aravind Sarikonda

Reputation: 86

Add <base href="." /> in index.html and remove <base href="/" />.

Upvotes: 7

Related Questions