DeprecationWarning: ‘getMutableClone’ has been deprecated since v4.0.0

Total
0
Shares

In TypeScript version 4.8 getMutableClone has been deprecated. Else it is suggested that you use setCommentRange or setSourceMapRange, and avoid setting parent.

Solution

1. Angular version should have compatible TypeScript version

You need to check if your Angular version has compatible TypeScript version. In order to know which Angular version supports which TS version, you can use this utility – https://update.angular.io/?l=3&v=13.0-14.0

2. Downgrade TS version

If the new TS version is breaking your existing application then it’s best to downgrade. To resolve this error, you can downgrade to version lesser than 4.8 –

npm i [email protected]"<4.8"

Or, you can add the TS version in your package.json file –

{
  ...
  "devDependencies" : {
     ...
     "typescript": "4.7.4"
  }
  ...
}