-2

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?

Santosh Hegde
  • 3,420
  • 10
  • 35
  • 51

2 Answers2

0

You might want to compile to ES2015.

Try adding this:

tsconfig.json
{
  "compilerOptions": {
    "module": "es2015",
    "target": "es2015"
  }
}
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
0

if you use require declaration change it to import

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

Ami Ine
  • 19
  • 6