angular-cli: Error in chunk main - HarmonyImportDependency
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10
- Versions. Please run
ng --version
. If there’s nothing outputted, please run in a Terminal:node --version
and paste the result here: angular-cli: 1.0.0-beta.11-webpack node: 4.3.0 os: win32 x64 - Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. Create with cli (systemjs). Upgraded to webpack
- The log given by the failure. Normally this include a stack trace and some more information. ERROR in chunk main [initial] [name].[chunkhash].bundle.js Template cannot be applied as TemplateArgument: HarmonyImportDependency
- Mention any other details that might be useful. Only happens with ng serve/build -prod. Dev works fine.
Thanks! We’ll be in touch soon.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 19 (6 by maintainers)
I have exact the same issue. When will the fix be available? $ ng version angular-cli: 1.0.0-beta.11-webpack.8 node: 5.7.1 os: darwin x64
I still get this bug on the most recent master, #1937 didn’t fix it for me @Brocco
angular-cli: ba668a8 node: Node v6.5.0 OS: Win10 x64
Yup I’m working on this, this is a problem with HarmonyDependencies and the DedupePlugin({}) https://github.com/webpack/webpack/issues/2644.
@filipesilva We need to remove
DedupePlugin({})
for now fromwebpack-build-production.ts
in the meantime to fix this.The fix for this issue on webpack’s side is pretty complex (because of
DedupePlugin
)The optimizations are very very minimal, and as long as users don’t make the mistake of importing dupes of dependencies, it shouldn’t be a problem.
npm dedupe
can help too (for the user).I have the same issue when I run ng build -prod
Closed via #1937
@andyrue it’s a webpack issue, think @thelarkinn is on it. 😃