profile
viewpoint

Ask questionsWARNING in Conflict: Multiple assets emit different content to the same filename 3rdpartylicenses.txt

<!--πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…

Oh hi there! πŸ˜„

To expedite issue processing please search open and closed issues before submitting a new one. Existing issues often contain information about workarounds, resolution, or progress updates.

πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…-->

🐞 Bug report

Command (mark with an x)

<!-- Can you pin-point the command or commands that are effected by this bug? --> <!-- ✍️edit: -->

  • [ ] new
  • [ ] build
  • [ ] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [ ] update
  • [ ] lint
  • [ ] xi18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc

Is this a regression?

<!-- Did this behavior use to work in the previous version? --> <!-- ✍️--> Yes, the previous version in which this bug was not present was: .8.x

Description

The following warning appears on production builds:

kamik@RED-X1C6 MINGW64 /d/sandbox/super-productivity (update-9)
$ yarn buildFrontend --output-path dist-ivy
yarn run v1.17.3
$ node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --aot --prod --output-path dist-ivy
69% building 889/891 modules 2 active ....js??ref--18-0!D:\sandbox\super-productivity\node_modules\@ngtools\webpack\src\index.js!D:\sandbox\super-productivity\src\app\core\compression\lz.worker.ts 69% building 1154/1157 modules 3 active ...-18-0!D:\sandbox\super-productivity\node_modules\@ngtools\webpack\src\index.js!D:\sandbox\super-productivity\src\app\features\reminder\reminder.worker.ts 
chunk {0} runtime.0f9d2f90a0d2148a4e14.js, runtime.0f9d2f90a0d2148a4e14.js.map (runtime) 1.51 kB [entry] [rendered]
chunk {1} main.9009a33894da809485f9.js, main.9009a33894da809485f9.js.map (main) 3.33 MB [initial] [rendered]
chunk {2} polyfills.75f8db4dd1e518a7835b.js, polyfills.75f8db4dd1e518a7835b.js.map (polyfills) 121 kB [initial] [rendered]
chunk {3} polyfills-es5.aca657e0425e42bebda6.js, polyfills-es5.aca657e0425e42bebda6.js.map (polyfills-es5) 201 kB [initial] [rendered]
chunk {4} styles.c5a09efce74a2a2c2e94.css, styles.c5a09efce74a2a2c2e94.css.map (styles) 167 kB [initial] [rendered]
Date: 2019-11-14T13:28:02.212Z - Hash: c21370451102fb263dbb - Time: 154136ms

WARNING in Conflict: Multiple assets emit different content to the same filename 3rdpartylicenses.txt
Done in 165.04s.

πŸ”¬ Minimal Reproduction

  • clone https://github.com/johannesjo/super-productivity
  • update to latest CLI, FW, and Material
  • add the following ngcc.onfig.js
module.exports = {
  packages: {
    'angular2-promise-buttons': {
      entryPoints: { '.': { override: {module: undefined} } }
    }
  }
};
  • build with either Ivy oe VE

πŸ”₯ Exception or Error

<pre><code> WARNING in Conflict: Multiple assets emit different content to the same filename 3rdpartylicenses.txt </code></pre>

🌍 Your Environment

<pre><code> Angular CLI: 9.0.0-rc.2 Node: 10.16.0 OS: win32 x64 Angular: 9.0.0-rc.2 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... platform-server, router, service-worker

Package Version

@angular-devkit/architect 0.900.0-rc.2 @angular-devkit/build-angular 0.900.0-rc.2 @angular-devkit/build-optimizer 0.900.0-rc.2 @angular-devkit/build-webpack 0.900.0-rc.2 @angular-devkit/core 9.0.0-rc.2 @angular-devkit/schematics 9.0.0-rc.2 @angular/cdk 9.0.0-rc.1 @angular/material 9.0.0-rc.1 @angular/material-moment-adapter 9.0.0-rc.1 @ngtools/webpack 9.0.0-rc.2 @schematics/angular 8.3.8 @schematics/update 0.900.0-rc.2 rxjs 6.5.3 typescript 3.6.4 webpack 4.41.2 </code></pre>

angular/angular-cli

Answer questions dgp1130

From @clydin:

The LicenseWebpackPlugin (https://github.com/xz64/license-webpack-plugin) emits the 3rdpartylicenses.txt file. The plugin uses the webpack compilation hook optimizeChunkAssetwhich can be called multiple times within a single compilation. (code: https://github.com/xz64/license-webpack-plugin/blob/master/src/WebpackCompilerHandler.ts#L27) This is the source of the multiple license assets. One case of this hook being called multiple times is the presence of stylesheets within the projects styles option. The MiniCssExtractPlugin used to output the CSS appears to call the hook while extracting the stylesheets from the internal webpack javascript variant of the stylesheet.

The emit hook would most likely be the more appropriate hook to use as this is called once at the completion of the compilation to output the files. This would necessitate a change to the plugin itself which is third-party.

An alternative could be to switch plugins to https://github.com/microsoft/license-checker-webpack-plugin which uses the emit hook.

The most obvious fix would be to update license-webpack-plugin to use the emit hook, however this could have ripple effects for the rest of the repo. Even if we fix the problem there, it may take some time for a stable release which we can depend on, which likely won't make the v9 release timeframe.

The other option would be to switch to Microsoft's license-checker-webpack-plugin, though this is probably more overall effort and would probably make google3 integration harder (Edit: @angular-devkit/build-angular is not included in the g3 build pipeline).

useful!
source:https://uonfu.com/
answerer
Douglas Parker dgp1130 Google, Inc. Software developer currently working on the Angular team.
Github User Rank List