after updating Docker Desktop, the build no longer works.
With ng serve in Visual Studio Code the application is built without error, but when it is done in Docker Desktop I get the following error:
`Error: node_modules/@types/lodash/common/object.d.ts:1026:46 – error TS1005: ‘?’ expected.
1026 : K extends ${infer N extends number}
? T[N]
~
Error: node_modules/@types/lodash/common/object.d.ts:1026:51 – error TS2536: Type ‘N’ cannot be used to index type ‘T’.
1026 : K extends ${infer N extends number}
? T[N]
~~~~
Error: node_modules/@types/lodash/common/object.d.ts:1031:46 – error TS1005: ‘?’ expected.
1031 : K extends ${infer N extends number}
? T[N]
~
Error: node_modules/@types/lodash/common/object.d.ts:1031:51 – error TS2536: Type ‘N’ cannot be used to index type ‘T’.
1031 : K extends ${infer N extends number}
? T[N]
~~~~
Error: node_modules/@types/lodash/common/object.d.ts:1041:46 – error TS1005: ‘?’ expected.
1041 : K extends `${infer N extends number}“
How can I fix the problem?
I have already installed the old version of Docker Desktop and still have the same problem.
2
This is a known issue with older versions of TypeScript. @types/lodash
if part of the DefinitelyTyped project which provides typings for packages. This project does not support older versions of TypeScript. As of September 2024, TypeScript 4.8 and later are supported. So you will either have to update TypeScript, or if that’s not possible, downgrade @types/lodash
by removing the ^
prefix to pin a version:
{
"devDependencies": {
"@types/lodash": "4.14.175"
}
}
Locally you probably still have an older version of @types/lodash
, but in the docker container when running npm install
a newer version is installed.