Recently, I updated my application to Angular 16 and the upgrade was successful. The application is running smoothly without any issues.
However, when I attempted to run the command for a production build,
ng build --configuration=production
I encountered the following error:
Error: Index html generation failed.
document.documentElement.setAttribute is not a function
Strangely, I do not have documentElement.setAttribute in my code, so I am unsure how to resolve this issue.
Setting optimization and buildOptimizer to false in angular.json temporarily fixed the problem, but I acknowledge that it is not the correct solution.
Any assistance or suggestions on how to address this would be highly appreciated.