[Fix] ‘getMutableClone’ has been deprecated since v4.0.0

Recently if you are using the TypeScript into Angular, it has started showing the error ‘getMutableClone’ has been deprecated since v4.0.0′.

Below is the error snippet:

'getMutableClone' has been deprecated since v4.0.0

Error ‘getMutableClone’ has been deprecated since v4.0.0′ is seen because of the recent typescript 4.8 version update. To fix the error, downgrade the typescript to version 4.7.4 using command ‘npm i typescript@4.7.4’ and error will be fixed.

Step to fix ‘getMutableClone’ has been deprecated since v4.0.0 Error:

As error itself mentioning, ‘getMutableClone’ has been depreciated since since version 4.0.0, if still you need to use getMutableClone then downgrade the version and it would fix the error DeprecationWarning: ‘getMutableClone’ has been deprecated since v4.0.0 for you.

There is nothing much you can do into your code on cli level to fix the issue except downgrading the typescript version to the stable one.

So use the command ‘npm i typescript@4.7.4‘ into angular and it would solve the error DeprecationWarning: ‘getMutableClone’ has been deprecated since v4.0.0 for you.

npm i typescript@4.7.4

Or use command to downgrade typescript version:

npm i typescript@"<4.8"

Note: Please use the ‘–force’ to above command if version downgrade doesn’t work directly.

It would install the typescript version 4.7.4 for you.

Now close the terminal and open again, you won’t face the error ‘getMutableClone’ has been deprecated since v4.0.0 again.