After several times adding <base href="/xxx/">
in the index.html and "deployUrl": "/xxx/",
of my angular.json /xxx/
being the directory to which the deployed site points, I still had the same problem. This post is what definitely allowed me to resolve the problem.
This issue occurs when using git-bash on Windows.
The git-bash sees the last argument of the command ng build --configuration development --base-href /xxx/
as a path relative to its binary folder and prepends the argument with that (it converts the "seems-to-be" relative path into an absolute path).
So, I used PowerShell instead of Git-Bash and the issue was gone.here is the stack overflow post which allowed me to solve the problem