Yes, the previous version in which this bug was not present was: 4.0.0
Description
When running a production build of Angular with version 13.2.2, it fails with an error after chunk generation completes.
This relates to using a dynamic import of a json file.
The error is: An unhandled exception occurred: Cannot read properties of undefined (reading 'name') (see below for extended error)
π¬ Minimal Reproduction
A dynamic import of a json file: import(`../../../../../assets/animations/${this.animation}.json`).then(animation => {
causes the error (Cannot read properties of undefined (reading 'name')
β Browser application bundle generation complete.
An unhandled exception occurred: Cannot read properties of undefined (reading 'name')
See "/tmp/ng-IvNqNx/angular-errors.log" for further details.
angular-errors.log:
[error] HookWebpackError: Cannot read properties of undefined (reading 'name')
at makeWebpackError (/scienta/resources/script/node_modules/webpack/lib/HookWebpackError.js:48:9)
at /scienta/resources/script/node_modules/webpack/lib/Compilation.js:3057:12
at eval (eval at create (/scienta/resources/script/node_modules/tapable/lib/HookCodeFactory.js:33:10), :31:1)
at fn (/scienta/resources/script/node_modules/webpack/lib/Compilation.js:478:17)
at _next4 (eval at create (/scienta/resources/script/node_modules/tapable/lib/HookCodeFactory.js:33:10), :28:1)
at eval (eval at create (/scienta/resources/script/node_modules/tapable/lib/HookCodeFactory.js:33:10), :46:1)
at fn (/scienta/resources/script/node_modules/webpack/lib/Compilation.js:490:9)
at _next3 (eval at create (/scienta/resources/script/node_modules/tapable/lib/HookCodeFactory.js:33:10), :41:1)
at eval (eval at create (/scienta/resources/script/node_modules/tapable/lib/HookCodeFactory.js:33:10), :60:1)
at runMicrotasks ()
-- inner error --
TypeError: Cannot read properties of undefined (reading 'name')
at PluginChunkReadHandler.extractIdentifiedModule (/scienta/resources/script/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:39:35)
at /scienta/resources/script/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:21:46
at WebpackInnerModuleIterator.internalCallback (/scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackInnerModuleIterator.js:39:13)
at WebpackInnerModuleIterator.iterateModules (/scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackInnerModuleIterator.js:21:9)
at /scienta/resources/script/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:20:39
at WebpackChunkModuleIterator.iterateModules (/scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackChunkModuleIterator.js:28:21)
at PluginChunkReadHandler.processChunk (/scienta/resources/script/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:19:29)
at _loop_1 (/scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:135:37)
at WebpackCompilerHandler.iterateChunks (/scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:160:17)
at /scienta/resources/script/node_modules/license-webpack-plugin/dist/WebpackCompilerHandler.js:50:31
π Bug report
Is this a regression?
Yes, the previous version in which this bug was not present was: 4.0.0
Description
When running a production build of Angular with version 13.2.2, it fails with an error after chunk generation completes. This relates to using a dynamic import of a json file. The error is:
An unhandled exception occurred: Cannot read properties of undefined (reading 'name')
(see below for extended error)π¬ Minimal Reproduction
import(`../../../../../assets/animations/${this.animation}.json`).then(animation => {
Cannot read properties of undefined (reading 'name')
extractIdentifiedModule
thedirectory
andpackageJson
are undefinedThe problem is caused by the changes in commit https://github.com/xz64/license-webpack-plugin/commit/55dd3f87c8f19338e45affec6f2271f75a0167ad
π₯ Exception or Error
Error
angular-errors.log
: