Skip to content

Instantly share code, notes, and snippets.

@thesuhu
Last active June 3, 2024 10:47
Show Gist options
  • Save thesuhu/7021a0956243f6dbe8034497da229bf0 to your computer and use it in GitHub Desktop.
Save thesuhu/7021a0956243f6dbe8034497da229bf0 to your computer and use it in GitHub Desktop.
How to Solve "ng build" Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type 'number'

How to Solve "ng build" Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type 'number'

Today I got error message when running "ng build" on my project using Angular version 12.0.1. The error message is Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type ‘number’.

To solve this problem, edit the file tsconfig.json (TypeScript compiler configuration) and add the following configuration to the compilerOptions key:

"compilerOptions": {

    "suppressImplicitAnyIndexErrors": true,
    "strictNullChecks": false,
    "strictPropertyInitialization": false,

}

Okay, that's it. hope it helps anyone having the same issue. If you find it useful please star (:star:) & share.

@SuperAzMe
Copy link

did anyone found the solution??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment