Skip to content

Angular app with the latest angular-cli tries to get assets (fonts and images) from the parent directory of the component instead of looking for them in the root directory #10386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Praefectus-praetorio opened this issue Apr 19, 2018 · 3 comments

Comments

@Praefectus-praetorio
Copy link

Praefectus-praetorio commented Apr 19, 2018

Angular app with the latest angular-cli gets assets (fonts and images) from the parent directory of the component. However as far as I understand from the configuration it should refer to the root path of the application.
image
The version and the angular.json file contents you may find below.

Versions

angular-cli 6.0.0-rc.5
@angular/compiler-cli@5.2.5
typescript 2.9.0-dev.20180414
node.js 8.11.1

Repro steps

Part of the angular.json file:

"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "abp-zero-template": {
      "root": "",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              },
              {
                "glob": "favicon.ico",
                "input": "src",
                "output": "/"
              },
              {
                "glob": "abp.signalr.js",
                "input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
                "output": "/assets/abp"
              },
              {
                "glob": "**.*",
                "input": "node_modules/bootstrap-select/dist/js/i18n",
                "output": "/assets/localization/bootstrap-select"
              },
              {
                "glob": "**.*",
                "input": "node_modules/timeago/locales",
                "output": "/assets/localization/jquery-timeago"
              }
            ]...

Observed behavior

Error 404 not found.

Desired behavior

As far as I understand the app should always look for the fonts and images using root path like:
http://domain.name/font.wff

instead of

http://domain.name/app/parent-folder-of-the-component-which-uses-this-font/font.wff.

Otherwise I will be forced to have dozens of assets duplicates across the app.

Just rolled back to angular-cli 1.7.4 and everything works fine.

@clydin
Copy link
Member

clydin commented Apr 19, 2018

Duplicate of #10378

@clydin clydin marked this as a duplicate of #10378 Apr 19, 2018
@clydin clydin closed this as completed Apr 19, 2018
@Jrubzjeknf
Copy link

Jrubzjeknf commented May 2, 2018

Are you certain this has been resolved? I'm running into the same issue using angular cli version 6.0.0-rc.9.

Edit: upgrading to Angular 6.0.0 seems to have resolved this issue.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants