This error occurs because the version of JavaScript used to configure TypeScript doesn't recognize replaceAll(). This method was added in ES2021 . To resolve this, update the lib array in tsconfig.json by adding the following:
{
...,
"compilerOptions": {
"lib": [..., "ES2021"]
},
...
}