Object.keys not response in the Ionic APP

I was using the Object.keys to push all my object’s key into the array, it test well in the browser ( Ionic serve --lab), but after ionic cordova build, Object.keys just return a empty array to me, and it seems very weird.

Screen Shot 2021-05-23 at 11.04.17 PM

As you can see the Object.keys only return an empty array which expect to return a two length array.

Even I use the for…in or Object.entires function, still no any return, so confused…

I don’t think this is the tsconfig.json problem because I had edit the lib property

"lib": ["es2018", "dom", "es2017.object"]

Can anyone help to figure out how to fixed this problem ?

Please don’t post images of text.

Since you have provided no code for anybody to try to reproduce the problem, all we can do is speculate wildly. I’ll speculate that you have a race condition that only presents under certain circumstances. One way to try to eliminate these sorts of problems is to turn on lots of strict compiler options, such as:

tsconfig.json

  "compilerOptions": {
...
    "strict": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
...
},
  "angularCompilerOptions": {
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  }

…then actually fix any problems that are flagged.