angular/angular-cli

Warning: 'outputHashing' option is disabled when using the dev-server

maks-humeniuk opened this issue Β· 3 comments

🐞 Bug report

Command (mark with an x)

  • serve

Is this a regression?

Probably, according to description. Not sure about the version though.

Description

There's no way to set "outputHashing" to "media" or "all" for ng serve (even for ng serve --prod). This, I guess, was possible before as per this answer by @filipesilva.

πŸ”¬ Minimal Reproduction

"build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
       ...
      "outputHashing": "media"
    },
    "configurations": {
      "production": {
          ...
      }
    }
  },

ng serve
ng serve --prod

The result is that media files aren't hashed.

This issue is related to #11852, #12186 and #19850.

πŸ”₯ Exception or Error


Warning: 'outputHashing' option is disabled when using the dev-server.
...
Warning: Conflict: Multiple assets emit different content to the same filename logo.png

🌍 Your Environment


    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 11.0.7
Node: 14.15.0
OS: win32 x64

Angular: 11.0.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.7
@angular-devkit/build-angular   0.1100.7
@angular-devkit/core            11.0.7
@angular-devkit/schematics      11.0.7
@angular/cli                    11.0.7
@schematics/angular             11.0.7
@schematics/update              0.1100.7
rxjs                            6.6.3
typescript                      4.0.5

Indeed this was possible in the past. However, since version 11. outputHashing is always disabled for dev-server.

Enabling outputHashing during development has the potential of causing memory leaks because the dev server does not know how to clean up the old files.

See: webpack/webpack-dev-server#377 and #19423

Let’s continue tracking this here: #12186 since that’s the root cause of the issue.

I do have a PR in flight to address that issue #19875

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.