Ionic 4 app not working in android Lollipop

928 Views Asked by At

I created an Ionic 4 android app which is working fine in Android 8. But when I test it in Android 5 (As an app and in the browser both), getting the below error.

Uncaught SyntaxError: Use of const in strict mode.       vendor.js:71605

Enabled polyfill.ts, but that didn't help.

How can I get rid of this?

2

There are 2 best solutions below

2
SiddAjmera On

You might want to compile to ES2015.

Try adding this:

tsconfig.json
{
  "compilerOptions": {
    "module": "es2015",
    "target": "es2015"
  }
}
0
Ami Ine On

if you use require declaration change it to import

import {foo} from 'bar'; Is equivalent to: var foo = require('bar').foo;