ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
127 stars 85 forks source link

Uncaught SyntaxError in vendor.js when running on Android #658

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @hebra on 2018-08-04T12:20:02Z

Bug Report

Ionic Info Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.0.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.1
   @angular-devkit/core       : 0.7.2
   @angular-devkit/schematics : 0.7.2
   @angular/cli               : 6.1.2
   @ionic/ng-toolkit          : 1.0.2
   @ionic/schematics-angular  : 1.0.3

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.1, ios 4.5.5

System:

   Android SDK Tools : 26.1.1
   ios-deploy        : 2.0.0
   NodeJS            : v10.8.0 (/usr/local/Cellar/node/10.8.0/bin/node)
   npm               : 6.2.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

Environment:

   ANDROID_HOME : /Users/heb/Library/Android/sdk

Describe the Bug Even the simplest myApp Ionic4/Angular6 demo does not proceed past the loading index.html when running on Android (device or emulator). Browser and iOS are fine.

Steps to Reproduce Steps to reproduce the behavior:

  1. Make sure an Android SDK is installed and in the PATH and env variables
  2. Create a test app, e.g. via ionic start myApp tabs --type=angular
  3. Start logcat e.g. from command line via adb logcat
  4. Add the Android platform via ionic cordova platform add android
  5. Run ionic cordova emulate android
  6. App starts but shows a blank white page (which is the index.html)

Related Log During app start up in the emulator the logcat logs the following error which I think is the root cause for the app not continuing loading.

D/SystemWebChromeClient( 6353): http://localhost:8080/vendor.js: Line 71984 : Uncaught SyntaxError: Use of const in strict mode.
I/chromium( 6353): [INFO:CONSOLE(71984)] "Uncaught SyntaxError: Use of const in strict mode.", source: http://localhost:8080/vendor.js (71984)
D/CordovaWebViewImpl( 6353): onPageFinished(http://localhost:8080/)

Expected Behavior App should finish starting up.

Additional Context This error only happens on Android devices and the emulator, but not when starting the app on Android via the Ionic DevApp tool.

nextbyn commented 5 years ago

Post your tsconfig.json in my case whas the target value

shaxxx commented 5 years ago

This is not a Ionic 3 bug. Bug is still very much alive in Ionic 4 beta 18. Someone should revert this to original bug and maybe take a look on ionic bot algo.