If you still run into the problem after adding the import '@angular/localize/init'
line, it might be that you need to move the line above all other imports, because order of imports is important. If some other import above uses $localize function, the error will persist