skip to Main Content

typescript version: 4.5.2
lodash version: 4.17.21

npm run build
tsc && react-scripts build


node_modules/@types/lodash/common/object.d.ts:1026:46 - error TS1005: '?' expected.
1026         : K extends `${infer N extends number}` ? T[N] <br/>
                                                  ~
node_modules/@types/lodash/common/object.d.ts:1031:46 - error TS1005: '?' expected.
1031         : K extends `${infer N extends number}` ? T[N] <br/>
                                                  ~
node_modules/@types/lodash/common/object.d.ts:1041:46 - error TS1005: '?' expected.
1041         : K extends `${infer N extends number}` <br/>
                                                  ~


Found 3 errors.

3

Answers


  1. i’m with the same problem. Some resolve?

    Login or Signup to reply.
  2. Use lodash version 4.17.5 works for me.

    I am using typescript version 4.6.4 and lodash version 4.17.5.

    Uninstall the current version (4.17.6) and reinstall 4.17.5 version

    npm uninstall @types/lodash

    npm install @types/[email protected]

    Then, the ng build should work

    Login or Signup to reply.
  3. try this

    "@types/lodash": "4.14.168"

    Finally ,It works like a charm ( "typescript": "4.1.5")

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search