Uncaught SyntaxError: Unexpected identifier when async/await is present





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I'm getting this error when I run the app on Android 6 or 7 and android Oreo (8.1)



This is the error that shows in the console from logcat



 1-23 10:02:18.208 24346-24346/chess.pidoweb I/chromium: [INFO:CONSOLE(10)] "The key "viewport-fit" is not recognized and ignored.", source: file:///android_asset/www/index.html (10)
11-23 10:02:18.644 24346-24354/? I/zygote64: Ignoring second debugger -- accepting and dropping
11-23 10:02:18.880 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:18.881 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:23.006 24346-24364/? V/FA: Inactivity, disconnecting from the service
11-23 10:02:24.519 24346-24346/? I/chromium: [INFO:CONSOLE(588)] **"Uncaught SyntaxError: Unexpected identifier", source: file:///android_asset/www/build/main.js (588)**
11-23 10:02:24.546 24346-24346/? D/XWalkCordovaUiClient: onPageLoadStopped(file:///android_asset/www/index.html)
11-23 10:02:24.546 24346-24346/? D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
11-23 10:02:26.572 24346-24346/? W/zygote64: Attempt to remove non-JNI local reference, dumping thread


Steps to Reproduce



run the project on the device android [Android APi 23 to 27 get the same problem] with the comand ->ionic cordova run android



Related Code



the line [588] is this->
async revisa_sincro() { < .....code....> }



Expected Behavior



So, the real issue is this [async ] keyword that stop the app and showme white screen and
this error on console Uncaught SyntaxError.
If I remove every async code the app runs OK. but I really need this async !!!



Additional Context
How I cant get to solve this problem, there is any workaround ?



Ionic Info



    Ionic:

ionic (Ionic CLI) : 4.0.0 (C:UsersexeAppDataRoamingnvmv8.11.2node_modulesionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.2

System:

NodeJS : v8.11.3 (C:Program Filesnodejsnode.exe)
npm : 5.6.0
OS : Windows 10


Packaje.json



  {
"name": "pidoionic",
"version": "0.0.10",
"description": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"config": {
"ionic_webpack": "config/webpack.config.js"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"@ionic-native/app-version": "4.17.0",
"@ionic-native/camera": "4.17.0",
"@ionic-native/core": "4.17.0",
"@ionic-native/device": "4.17.0",
"@ionic-native/fcm": "^4.17.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/firebase": "^4.17.0",
"@ionic-native/google-analytics": "4.17.0",
"@ionic-native/google-plus": "4.17.0",
"@ionic-native/image-resizer": "4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/native-storage": "^4.17.0",
"@ionic-native/splash-screen": "~4.17.0",
"@ionic-native/sqlite": "^4.17.0",
"@ionic-native/sqlite-porter": "^4.17.0",
"@ionic-native/status-bar": "4.17.0",
"@ionic-native/unique-device-id": "^4.17.0",
"@ionic-native/youtube-video-player": "4.17.0",
"@ionic/pro": "2.0.3",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@types/google-maps": "^3.2.0",
"angular2-uuid": "^1.1.1",
"angularfire2": "^5.1.0",
"cordova": "^8.0.0",
"cordova-android": "7.1.2",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-browser": "5.0.3",
"cordova-ios": "4.5.5",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-ionic-webview": "2.2.5",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googleplus": "~5.3.2",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-youtube-video-player": "^2.0.0",
"cordova-sqlite-storage": "^2.5.1",
"firebase": "^5.5.9",
"global": "^4.3.2",
"imagemin": "^5.3.1",
"info.protonet.imageresizer": "^0.1.1",
"ionic": "^3.20.1",
"ionic-angular": "3.9.2",
"ionic-tooltips": "^2.1.1",
"ionicons": "4.2.6",
"jquery": "^3.3.1",
"local-storage": "^1.4.2",
"moment": "^1.7.2",
"ng-lottie": "^0.3.2",
"ng2-reactive-forms-validators": "^1.1.0",
"promise-polyfill": "8.1.0",
"q": "^1.5.1",
"run": "1.4.0",
"rxjs": "^6.3.2",
"rxjs-compat": "^6.3.2",
"sqlite3": "^4.0.0",
"sw-toolbox": "3.6.0",
"typeorm": "0.2.8",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "7.0.6",
"@angular/compiler": "7.1.0",
"@angular/compiler-cli": "7.1.0",
"@ionic/app-scripts": "3.2.0",
"@types/google.analytics": "0.0.39",
"@types/googlemaps": "^3.30.11",
"@types/node": "^10.5.4",
"sql.js": "^0.5.0",
"ts-node": "7.0.0",
"typescript": "3.1.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-device",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": ,
"cordova": {
"plugins": {
"cordova-sqlite-storage": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"info.protonet.imageresizer": {},
"cordova-plugin-camera": {},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.781145103219-a87b3bd7d7858i8lrr2531nm8ml2bj6c",
"WEB_APPLICATION_CLIENT_ID": "781145103219-vn75hrm8tv0b54hkck4dokv5nnr0pvao.apps.ioniusercontent.com"
},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-uniquedeviceid": {},
"cordova-plugin-app-version": {},
"cordova-plugin-nativestorage": {},
"cordova-plugin-file": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-local-notification": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
}
},
"platforms": [
"browser",
"ios",
"android"
]
}
}


Update:
tsconfig.json



{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"lib": [
"dom",
"es2017"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "ES2017",
"types" : ["node"],
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"src/**/*.spec.ts",
"src/**/__tests__/*.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}









share|improve this question

























  • Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:28











  • @TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

    – exequielc
    Nov 23 '18 at 13:37


















1















I'm getting this error when I run the app on Android 6 or 7 and android Oreo (8.1)



This is the error that shows in the console from logcat



 1-23 10:02:18.208 24346-24346/chess.pidoweb I/chromium: [INFO:CONSOLE(10)] "The key "viewport-fit" is not recognized and ignored.", source: file:///android_asset/www/index.html (10)
11-23 10:02:18.644 24346-24354/? I/zygote64: Ignoring second debugger -- accepting and dropping
11-23 10:02:18.880 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:18.881 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:23.006 24346-24364/? V/FA: Inactivity, disconnecting from the service
11-23 10:02:24.519 24346-24346/? I/chromium: [INFO:CONSOLE(588)] **"Uncaught SyntaxError: Unexpected identifier", source: file:///android_asset/www/build/main.js (588)**
11-23 10:02:24.546 24346-24346/? D/XWalkCordovaUiClient: onPageLoadStopped(file:///android_asset/www/index.html)
11-23 10:02:24.546 24346-24346/? D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
11-23 10:02:26.572 24346-24346/? W/zygote64: Attempt to remove non-JNI local reference, dumping thread


Steps to Reproduce



run the project on the device android [Android APi 23 to 27 get the same problem] with the comand ->ionic cordova run android



Related Code



the line [588] is this->
async revisa_sincro() { < .....code....> }



Expected Behavior



So, the real issue is this [async ] keyword that stop the app and showme white screen and
this error on console Uncaught SyntaxError.
If I remove every async code the app runs OK. but I really need this async !!!



Additional Context
How I cant get to solve this problem, there is any workaround ?



Ionic Info



    Ionic:

ionic (Ionic CLI) : 4.0.0 (C:UsersexeAppDataRoamingnvmv8.11.2node_modulesionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.2

System:

NodeJS : v8.11.3 (C:Program Filesnodejsnode.exe)
npm : 5.6.0
OS : Windows 10


Packaje.json



  {
"name": "pidoionic",
"version": "0.0.10",
"description": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"config": {
"ionic_webpack": "config/webpack.config.js"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"@ionic-native/app-version": "4.17.0",
"@ionic-native/camera": "4.17.0",
"@ionic-native/core": "4.17.0",
"@ionic-native/device": "4.17.0",
"@ionic-native/fcm": "^4.17.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/firebase": "^4.17.0",
"@ionic-native/google-analytics": "4.17.0",
"@ionic-native/google-plus": "4.17.0",
"@ionic-native/image-resizer": "4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/native-storage": "^4.17.0",
"@ionic-native/splash-screen": "~4.17.0",
"@ionic-native/sqlite": "^4.17.0",
"@ionic-native/sqlite-porter": "^4.17.0",
"@ionic-native/status-bar": "4.17.0",
"@ionic-native/unique-device-id": "^4.17.0",
"@ionic-native/youtube-video-player": "4.17.0",
"@ionic/pro": "2.0.3",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@types/google-maps": "^3.2.0",
"angular2-uuid": "^1.1.1",
"angularfire2": "^5.1.0",
"cordova": "^8.0.0",
"cordova-android": "7.1.2",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-browser": "5.0.3",
"cordova-ios": "4.5.5",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-ionic-webview": "2.2.5",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googleplus": "~5.3.2",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-youtube-video-player": "^2.0.0",
"cordova-sqlite-storage": "^2.5.1",
"firebase": "^5.5.9",
"global": "^4.3.2",
"imagemin": "^5.3.1",
"info.protonet.imageresizer": "^0.1.1",
"ionic": "^3.20.1",
"ionic-angular": "3.9.2",
"ionic-tooltips": "^2.1.1",
"ionicons": "4.2.6",
"jquery": "^3.3.1",
"local-storage": "^1.4.2",
"moment": "^1.7.2",
"ng-lottie": "^0.3.2",
"ng2-reactive-forms-validators": "^1.1.0",
"promise-polyfill": "8.1.0",
"q": "^1.5.1",
"run": "1.4.0",
"rxjs": "^6.3.2",
"rxjs-compat": "^6.3.2",
"sqlite3": "^4.0.0",
"sw-toolbox": "3.6.0",
"typeorm": "0.2.8",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "7.0.6",
"@angular/compiler": "7.1.0",
"@angular/compiler-cli": "7.1.0",
"@ionic/app-scripts": "3.2.0",
"@types/google.analytics": "0.0.39",
"@types/googlemaps": "^3.30.11",
"@types/node": "^10.5.4",
"sql.js": "^0.5.0",
"ts-node": "7.0.0",
"typescript": "3.1.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-device",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": ,
"cordova": {
"plugins": {
"cordova-sqlite-storage": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"info.protonet.imageresizer": {},
"cordova-plugin-camera": {},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.781145103219-a87b3bd7d7858i8lrr2531nm8ml2bj6c",
"WEB_APPLICATION_CLIENT_ID": "781145103219-vn75hrm8tv0b54hkck4dokv5nnr0pvao.apps.ioniusercontent.com"
},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-uniquedeviceid": {},
"cordova-plugin-app-version": {},
"cordova-plugin-nativestorage": {},
"cordova-plugin-file": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-local-notification": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
}
},
"platforms": [
"browser",
"ios",
"android"
]
}
}


Update:
tsconfig.json



{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"lib": [
"dom",
"es2017"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "ES2017",
"types" : ["node"],
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"src/**/*.spec.ts",
"src/**/__tests__/*.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}









share|improve this question

























  • Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:28











  • @TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

    – exequielc
    Nov 23 '18 at 13:37














1












1








1


1






I'm getting this error when I run the app on Android 6 or 7 and android Oreo (8.1)



This is the error that shows in the console from logcat



 1-23 10:02:18.208 24346-24346/chess.pidoweb I/chromium: [INFO:CONSOLE(10)] "The key "viewport-fit" is not recognized and ignored.", source: file:///android_asset/www/index.html (10)
11-23 10:02:18.644 24346-24354/? I/zygote64: Ignoring second debugger -- accepting and dropping
11-23 10:02:18.880 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:18.881 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:23.006 24346-24364/? V/FA: Inactivity, disconnecting from the service
11-23 10:02:24.519 24346-24346/? I/chromium: [INFO:CONSOLE(588)] **"Uncaught SyntaxError: Unexpected identifier", source: file:///android_asset/www/build/main.js (588)**
11-23 10:02:24.546 24346-24346/? D/XWalkCordovaUiClient: onPageLoadStopped(file:///android_asset/www/index.html)
11-23 10:02:24.546 24346-24346/? D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
11-23 10:02:26.572 24346-24346/? W/zygote64: Attempt to remove non-JNI local reference, dumping thread


Steps to Reproduce



run the project on the device android [Android APi 23 to 27 get the same problem] with the comand ->ionic cordova run android



Related Code



the line [588] is this->
async revisa_sincro() { < .....code....> }



Expected Behavior



So, the real issue is this [async ] keyword that stop the app and showme white screen and
this error on console Uncaught SyntaxError.
If I remove every async code the app runs OK. but I really need this async !!!



Additional Context
How I cant get to solve this problem, there is any workaround ?



Ionic Info



    Ionic:

ionic (Ionic CLI) : 4.0.0 (C:UsersexeAppDataRoamingnvmv8.11.2node_modulesionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.2

System:

NodeJS : v8.11.3 (C:Program Filesnodejsnode.exe)
npm : 5.6.0
OS : Windows 10


Packaje.json



  {
"name": "pidoionic",
"version": "0.0.10",
"description": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"config": {
"ionic_webpack": "config/webpack.config.js"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"@ionic-native/app-version": "4.17.0",
"@ionic-native/camera": "4.17.0",
"@ionic-native/core": "4.17.0",
"@ionic-native/device": "4.17.0",
"@ionic-native/fcm": "^4.17.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/firebase": "^4.17.0",
"@ionic-native/google-analytics": "4.17.0",
"@ionic-native/google-plus": "4.17.0",
"@ionic-native/image-resizer": "4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/native-storage": "^4.17.0",
"@ionic-native/splash-screen": "~4.17.0",
"@ionic-native/sqlite": "^4.17.0",
"@ionic-native/sqlite-porter": "^4.17.0",
"@ionic-native/status-bar": "4.17.0",
"@ionic-native/unique-device-id": "^4.17.0",
"@ionic-native/youtube-video-player": "4.17.0",
"@ionic/pro": "2.0.3",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@types/google-maps": "^3.2.0",
"angular2-uuid": "^1.1.1",
"angularfire2": "^5.1.0",
"cordova": "^8.0.0",
"cordova-android": "7.1.2",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-browser": "5.0.3",
"cordova-ios": "4.5.5",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-ionic-webview": "2.2.5",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googleplus": "~5.3.2",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-youtube-video-player": "^2.0.0",
"cordova-sqlite-storage": "^2.5.1",
"firebase": "^5.5.9",
"global": "^4.3.2",
"imagemin": "^5.3.1",
"info.protonet.imageresizer": "^0.1.1",
"ionic": "^3.20.1",
"ionic-angular": "3.9.2",
"ionic-tooltips": "^2.1.1",
"ionicons": "4.2.6",
"jquery": "^3.3.1",
"local-storage": "^1.4.2",
"moment": "^1.7.2",
"ng-lottie": "^0.3.2",
"ng2-reactive-forms-validators": "^1.1.0",
"promise-polyfill": "8.1.0",
"q": "^1.5.1",
"run": "1.4.0",
"rxjs": "^6.3.2",
"rxjs-compat": "^6.3.2",
"sqlite3": "^4.0.0",
"sw-toolbox": "3.6.0",
"typeorm": "0.2.8",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "7.0.6",
"@angular/compiler": "7.1.0",
"@angular/compiler-cli": "7.1.0",
"@ionic/app-scripts": "3.2.0",
"@types/google.analytics": "0.0.39",
"@types/googlemaps": "^3.30.11",
"@types/node": "^10.5.4",
"sql.js": "^0.5.0",
"ts-node": "7.0.0",
"typescript": "3.1.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-device",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": ,
"cordova": {
"plugins": {
"cordova-sqlite-storage": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"info.protonet.imageresizer": {},
"cordova-plugin-camera": {},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.781145103219-a87b3bd7d7858i8lrr2531nm8ml2bj6c",
"WEB_APPLICATION_CLIENT_ID": "781145103219-vn75hrm8tv0b54hkck4dokv5nnr0pvao.apps.ioniusercontent.com"
},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-uniquedeviceid": {},
"cordova-plugin-app-version": {},
"cordova-plugin-nativestorage": {},
"cordova-plugin-file": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-local-notification": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
}
},
"platforms": [
"browser",
"ios",
"android"
]
}
}


Update:
tsconfig.json



{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"lib": [
"dom",
"es2017"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "ES2017",
"types" : ["node"],
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"src/**/*.spec.ts",
"src/**/__tests__/*.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}









share|improve this question
















I'm getting this error when I run the app on Android 6 or 7 and android Oreo (8.1)



This is the error that shows in the console from logcat



 1-23 10:02:18.208 24346-24346/chess.pidoweb I/chromium: [INFO:CONSOLE(10)] "The key "viewport-fit" is not recognized and ignored.", source: file:///android_asset/www/index.html (10)
11-23 10:02:18.644 24346-24354/? I/zygote64: Ignoring second debugger -- accepting and dropping
11-23 10:02:18.880 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:18.881 24346-24428/? W/chromium: [WARNING:sqlite_persistent_cookie_store.cc(851)] Cookie database is too new.
11-23 10:02:23.006 24346-24364/? V/FA: Inactivity, disconnecting from the service
11-23 10:02:24.519 24346-24346/? I/chromium: [INFO:CONSOLE(588)] **"Uncaught SyntaxError: Unexpected identifier", source: file:///android_asset/www/build/main.js (588)**
11-23 10:02:24.546 24346-24346/? D/XWalkCordovaUiClient: onPageLoadStopped(file:///android_asset/www/index.html)
11-23 10:02:24.546 24346-24346/? D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
11-23 10:02:26.572 24346-24346/? W/zygote64: Attempt to remove non-JNI local reference, dumping thread


Steps to Reproduce



run the project on the device android [Android APi 23 to 27 get the same problem] with the comand ->ionic cordova run android



Related Code



the line [588] is this->
async revisa_sincro() { < .....code....> }



Expected Behavior



So, the real issue is this [async ] keyword that stop the app and showme white screen and
this error on console Uncaught SyntaxError.
If I remove every async code the app runs OK. but I really need this async !!!



Additional Context
How I cant get to solve this problem, there is any workaround ?



Ionic Info



    Ionic:

ionic (Ionic CLI) : 4.0.0 (C:UsersexeAppDataRoamingnvmv8.11.2node_modulesionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.2

System:

NodeJS : v8.11.3 (C:Program Filesnodejsnode.exe)
npm : 5.6.0
OS : Windows 10


Packaje.json



  {
"name": "pidoionic",
"version": "0.0.10",
"description": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"config": {
"ionic_webpack": "config/webpack.config.js"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"@ionic-native/app-version": "4.17.0",
"@ionic-native/camera": "4.17.0",
"@ionic-native/core": "4.17.0",
"@ionic-native/device": "4.17.0",
"@ionic-native/fcm": "^4.17.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/firebase": "^4.17.0",
"@ionic-native/google-analytics": "4.17.0",
"@ionic-native/google-plus": "4.17.0",
"@ionic-native/image-resizer": "4.17.0",
"@ionic-native/local-notifications": "^4.17.0",
"@ionic-native/native-storage": "^4.17.0",
"@ionic-native/splash-screen": "~4.17.0",
"@ionic-native/sqlite": "^4.17.0",
"@ionic-native/sqlite-porter": "^4.17.0",
"@ionic-native/status-bar": "4.17.0",
"@ionic-native/unique-device-id": "^4.17.0",
"@ionic-native/youtube-video-player": "4.17.0",
"@ionic/pro": "2.0.3",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@types/google-maps": "^3.2.0",
"angular2-uuid": "^1.1.1",
"angularfire2": "^5.1.0",
"cordova": "^8.0.0",
"cordova-android": "7.1.2",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-browser": "5.0.3",
"cordova-ios": "4.5.5",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-ionic-webview": "2.2.5",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googleplus": "~5.3.2",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-uniquedeviceid": "^1.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-youtube-video-player": "^2.0.0",
"cordova-sqlite-storage": "^2.5.1",
"firebase": "^5.5.9",
"global": "^4.3.2",
"imagemin": "^5.3.1",
"info.protonet.imageresizer": "^0.1.1",
"ionic": "^3.20.1",
"ionic-angular": "3.9.2",
"ionic-tooltips": "^2.1.1",
"ionicons": "4.2.6",
"jquery": "^3.3.1",
"local-storage": "^1.4.2",
"moment": "^1.7.2",
"ng-lottie": "^0.3.2",
"ng2-reactive-forms-validators": "^1.1.0",
"promise-polyfill": "8.1.0",
"q": "^1.5.1",
"run": "1.4.0",
"rxjs": "^6.3.2",
"rxjs-compat": "^6.3.2",
"sqlite3": "^4.0.0",
"sw-toolbox": "3.6.0",
"typeorm": "0.2.8",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "7.0.6",
"@angular/compiler": "7.1.0",
"@angular/compiler-cli": "7.1.0",
"@ionic/app-scripts": "3.2.0",
"@types/google.analytics": "0.0.39",
"@types/googlemaps": "^3.30.11",
"@types/node": "^10.5.4",
"sql.js": "^0.5.0",
"ts-node": "7.0.0",
"typescript": "3.1.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-device",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": ,
"cordova": {
"plugins": {
"cordova-sqlite-storage": {},
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": " "
},
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"info.protonet.imageresizer": {},
"cordova-plugin-camera": {},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.781145103219-a87b3bd7d7858i8lrr2531nm8ml2bj6c",
"WEB_APPLICATION_CLIENT_ID": "781145103219-vn75hrm8tv0b54hkck4dokv5nnr0pvao.apps.ioniusercontent.com"
},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-uniquedeviceid": {},
"cordova-plugin-app-version": {},
"cordova-plugin-nativestorage": {},
"cordova-plugin-file": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-local-notification": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
}
},
"platforms": [
"browser",
"ios",
"android"
]
}
}


Update:
tsconfig.json



{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"lib": [
"dom",
"es2017"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "ES2017",
"types" : ["node"],
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"src/**/*.spec.ts",
"src/**/__tests__/*.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}






android angular typescript ionic-framework ionic3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 13:37







exequielc

















asked Nov 23 '18 at 13:25









exequielcexequielc

358420




358420













  • Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:28











  • @TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

    – exequielc
    Nov 23 '18 at 13:37



















  • Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:28











  • @TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

    – exequielc
    Nov 23 '18 at 13:37

















Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

– Titian Cernicova-Dragomir
Nov 23 '18 at 13:28





Probably the runtime does not have native support for async/await what target do you specify in your tsconfig.json?

– Titian Cernicova-Dragomir
Nov 23 '18 at 13:28













@TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

– exequielc
Nov 23 '18 at 13:37





@TitianCernicova-Dragomir I've added the tsconfig.ts to the issue. ES2017 is present in tsconfig.json

– exequielc
Nov 23 '18 at 13:37












1 Answer
1






active

oldest

votes


















2














Two things to check...



ECMAScript Version



You can target different ECMAScript versions with the TypeScript compiler, so make sure you are targeting the version you are using at runtime. i.e. in your tsconfig.json file:



"target": "ES5"


This will then transform your async/await into a format usable in that runtime.



JavaScript



If you have done the above and still have a problem, it is commonly caused by loading the TypeScript file .ts by accident at runtime, rather than the JavaScript .js file.






share|improve this answer
























  • It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:41












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447562%2funcaught-syntaxerror-unexpected-identifier-when-async-await-is-present%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Two things to check...



ECMAScript Version



You can target different ECMAScript versions with the TypeScript compiler, so make sure you are targeting the version you are using at runtime. i.e. in your tsconfig.json file:



"target": "ES5"


This will then transform your async/await into a format usable in that runtime.



JavaScript



If you have done the above and still have a problem, it is commonly caused by loading the TypeScript file .ts by accident at runtime, rather than the JavaScript .js file.






share|improve this answer
























  • It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:41
















2














Two things to check...



ECMAScript Version



You can target different ECMAScript versions with the TypeScript compiler, so make sure you are targeting the version you are using at runtime. i.e. in your tsconfig.json file:



"target": "ES5"


This will then transform your async/await into a format usable in that runtime.



JavaScript



If you have done the above and still have a problem, it is commonly caused by loading the TypeScript file .ts by accident at runtime, rather than the JavaScript .js file.






share|improve this answer
























  • It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:41














2












2








2







Two things to check...



ECMAScript Version



You can target different ECMAScript versions with the TypeScript compiler, so make sure you are targeting the version you are using at runtime. i.e. in your tsconfig.json file:



"target": "ES5"


This will then transform your async/await into a format usable in that runtime.



JavaScript



If you have done the above and still have a problem, it is commonly caused by loading the TypeScript file .ts by accident at runtime, rather than the JavaScript .js file.






share|improve this answer













Two things to check...



ECMAScript Version



You can target different ECMAScript versions with the TypeScript compiler, so make sure you are targeting the version you are using at runtime. i.e. in your tsconfig.json file:



"target": "ES5"


This will then transform your async/await into a format usable in that runtime.



JavaScript



If you have done the above and still have a problem, it is commonly caused by loading the TypeScript file .ts by accident at runtime, rather than the JavaScript .js file.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 13:30









FentonFenton

158k46296319




158k46296319













  • It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:41



















  • It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

    – Titian Cernicova-Dragomir
    Nov 23 '18 at 13:41

















It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

– Titian Cernicova-Dragomir
Nov 23 '18 at 13:41





It might also work with es2015 depends what kind of backward compatibility you want, es5 is probably the safer option, but the js async/await code will be .. less than readable ..

– Titian Cernicova-Dragomir
Nov 23 '18 at 13:41




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447562%2funcaught-syntaxerror-unexpected-identifier-when-async-await-is-present%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]