AHmedRef
AHmedRef

Reputation: 2611

ionic 3 SyntaxError : "unexpected token =>"

Im building ionic 3 (angular5+es2015) application for android OS, it's working for android 7,8, and 9 but not for 6 version, and i got this error when startup application :

enter image description here

Any help please !

Upvotes: 0

Views: 148

Answers (1)

Jesse Hallett
Jesse Hallett

Reputation: 2007

I think the issue is that the Javascript VM in Android 6 is too old to have support for arrow functions. The solution would be to use a transpiler like Babel to target the older VM, or to rewrite your code to remove uses of ES6 language features.

Edit: I'm sorry, I realized that there is a "Typescript" tag on this question. You might be able to adjust the target setting in tsconfig.json to output code that is compatible with the older Javascript version. Try using ES5, or if that does not work you can try ES3.

Upvotes: 1

Related Questions