angularangular8document-body

Angular strange behavior in production mode


When I'm building my project in production mode ng build --prod --output-path=../Angular --base-href=/autopoint/ --deploy-url=/autopoint/Angular/, a strange line at the top of the html before the tag appears but when I'm running it with an ng serve, it is gone. Any ideas what this might be caused by?

_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AutoPoint</title>
    <base href="/" />
    <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,600,800&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    @Styles.Render("~/Angular/Styles")
</head>
<body id="app">

@RenderBody()


    @Scripts.RenderFormat("<script src='{0}' type='module'></script>", "~/Angular/Scripts")
    @Scripts.RenderFormat("<script src='{0}' nomodule defer></script>", "~/Angular/ScriptsIE")
</body>
</html>

Index.cshtml

<app-root></app-root>

enter image description here

enter image description here


Solution

  • Problem is solved. Invisible whitespace character. enter image description here