Ionic-framework: [v4.6.0] bug: svg file is not found when use baseHref

Created on 27 Jun 2019  路  7Comments  路  Source: ionic-team/ionic-framework

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
triage

Most helpful comment

This was fixed in 4.6.1.

All 7 comments

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!

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

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! 馃檪

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

image

Is this fixed or just closed?

This was fixed in 4.6.1.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alan-agius4 picture alan-agius4  路  3Comments

giammaleoni picture giammaleoni  路  3Comments

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  路  3Comments

RobFerguson picture RobFerguson  路  3Comments

manucorporat picture manucorporat  路  3Comments