Uncaught SyntaxError: Unexpected identifier on Fresh Install

I have created a new project and when i am trying to run app i am getting blank page with this error:

Please reply and help me to get rid of this issue

2 Likes

I am experiencing this same problem (a white screen is displayed on my Android device) with a freshly installed template created by ionic start myApp tabs.

cli packages: (C:\Users\Kyle\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.9.1
    npm  : 5.5.1
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

The line of code that throws the syntax error is below:

Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"C:\Users\Kyle\Desktop\NF2\myApp\src\pages\tabs\tabs.html"*/`<ion-tabs>\n  <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>\n  <ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>\n  <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>\n</ion-tabs>\n`/*ion-inline-end:"C:\Users\Kyle\Desktop\NF2\myApp\src\pages\tabs\tabs.html"*/

I believe the backtick character ` may be the cause of the syntax error.
According to https://caniuse.com/#feat=template-literals, template literals are not supported by Android 4.4.
If anyone knows a solution to this, please let me know.

I am also using android 4.4 for testing.

Installed crosswalk which solved the issue for android 4.4 but messed up on android > 5

viewport-fit is used for compatibilty with the iPhone X.
Older browsers (Android 4.4 and such) don’t recognize this and throw an error.

This error shoudn’t impact the ionic application in one way or another.

We are talking about below error. viewport-fit anyway ignored if it is not iphone X

Have there been any more updates to this issue? Please help.

I’m experiencing the same error on an android device.

$ ionic info

cli packages: (C:\Users\vthilagar\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.18.0
ionic (Ionic CLI) : 3.18.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v6.11.0
npm  : 4.4.1
OS   : Windows 7

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

Created a new project and didn’t get this issue again.

1 Like

Thanks - thats what I’m trying now.

same issue on same line in android 4.2

Just found out that this error was caused by a bug that was released with 3.1.0.

We were able to avoid it by running npm install @ionic/app-scripts@latest and trying again.

Please note: Your experience may be different that ours. Good luck.

3 Likes

This worked for me! I had tried using command ionic run android --device --livereload on an existing and new project, but came across this the error mentioned above. But this fixed the issue

Thank you! :slight_smile:

I find the same problem, does someone solve it?
Android 4.2.4

I have the same problem. I get this error on my tablet while it’s running normally on mobile devices. How did you solve it?