Skip to content

[v4.6.0] bug: svg file is not found when use baseHref #18637

Closed

Description

@Jimmysh

Bug Report

Ionic version:

[x] 4.6

Current behavior:

all of ionic icon svg file is not found (404)

Expected behavior:

Steps to reproduce:

Related code:

https://github.com/Jimmysh/ionic-4.6.0-bug

angular.json
{
  "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
  "version": 1,
  "defaultProject": "app",
  "newProjectRoot": "projects",
  "projects": {
    "app": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "www",
            "index": "src/index.html",
            "main": "src/main.ts",
            "baseHref": "/en/",   --- use baseHref

Other information:

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 5.0.0-beta.2 (/Users/jimmy/.config/yarn/global/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.6.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   NodeJS : v10.16.0 (/Users/jimmy/.nvm/versions/node/v10.16.0/bin/node)
   npm    : 6.9.0
   OS     : macOS

Activity

  1. liamdebeasi commented on Jun 27, 2019

    @liamdebeasi
    Contributor

    Thanks for the issue. It looks like you are trying to modify the baseHref of your application. Certain things like ionicons need to be served from the root in order to work properly.

    If you would like to change your app's routing structure, we recommend using the Angular Router to accomplish this, not a project/build configuration file.

    I am going to close this as this is not an Ionic bug.

    Thanks!

  2. Jimmysh commented on Jun 28, 2019

    @Jimmysh
    Author

    @liamdebeasi basehref is always supported until v4.6 release. It is optional for me. because It is easy fix after prod build.

  3. liamdebeasi commented on Jul 1, 2019

    @liamdebeasi
    Contributor

    Thanks! I think I may have misunderstood the original issue, so I am going to reopen this. We are investigating now, and I will update this thread when there is more to share.

    Thanks! 🙂

  4. pauloedsr commented on Jul 5, 2019

    @pauloedsr

    the build with the --base-href ng build --base-href /path-web-server/ --prod is not working with the svg ionicons

    image

  5. l0co commented on Jul 16, 2019

    @l0co

    Is this fixed or just closed?

  6. liamdebeasi commented on Jul 16, 2019

    @liamdebeasi
    Contributor

    This was fixed in 4.6.1.

  7. ionitron-bot commented on Aug 15, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  8. locked and limited conversation to collaborators on Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions