Uncaught SyntaxError in vendor.js when running on Android
See original GitHub issueBug 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: 0. Make sure an Android SDK is installed and in the PATH and env variables
- Create a test app, e.g. via
ionic start myApp tabs --type=angular
- Start logcat e.g. from command line via
adb logcat
- Add the Android platform via
ionic cordova platform add android
- Run
ionic cordova emulate android
- 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:31 (2 by maintainers)
Top Results From Across the Web
Unexpected token ? during run ionic 6 application on android ...
File: http://localhost/vendor.js - Line 24288 - Msg: Uncaught SyntaxError: Unexpected token ? when I run the application in the android ...
Read more >Unexpected identifier vendor.js in android 5 and android 6.
App stucks with white screen and gives following error Uncaught SyntaxError: Unexpected identifier. Anyone have any idea. Thanks in advance.
Read more >Ionic 4 and Angular 6: Uncaught SyntaxError in vendor.js ...
I am currently facing a problem when starting an Ionic 4 + Angular 6 when starting the App on any Android device or...
Read more >Uncaught SyntaxError: Unexpected end of JSON input
A common error encountered by JavaScript programmers is the Uncaught SyntaxError: Unexpected end of JSON input. This is usually observed when the coder...
Read more >Resolve! Uncaught SyntaxError: Unexpected token ',' or '
To create a production build for a remote server I usually run following ng command: $ ng build --prod But at the client...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the reason: the compiled code of
@ionic/angular
is not thees5
code. It use the newasync/await
keyword inES2017
.Thanks @timhill1989 - I can confirm that it is actually working with Android 8.x but not any older version. Considering the current market share for Oreo of just 10% I see this as a blocker for Ionic 4 right now. At least 6 (23%) & 7 (34%) have to be supported as well, better include 5 (15%) as well.