Open Closed

ng serve --base-href doesn't find assets #25


0
AlainLeicht created

Hi,

When the Angular application is served with a base path (--base-href), then logo and favicon files loading result in a 404. The console shows that the urls don't include the base path. Rest of the application works fine.

Could you help me with that?

Thank you and best regards


6 Answer(s)
  • 0
    Mehmet created
    Support Team

    Hi,

    Can you share your start and build commands with us?

  • 0
    AlainLeicht created
    "start": "ng serve --baseHref=/my/base/path/",
    "build": "ng build --baseHref=/my/base/path/",
    
  • 0
    Mehmet created
    Support Team

    I fixed the logo problem but I have not encountered any errors related to favicon.

    Please share the head element in the index.html with me.

  • 0
    AlainLeicht created

  • 0
    Mehmet created
    Support Team

    Everything looks good. Would you try again with base href="/". Does the problem continue in this way?

  • 0
    AlainLeicht created

    It works fine now, thank you !