Search code examples
angularwebpackgulpyarnpkg

Module not found: Error: Can't resolve '@angular/platform-browser/animations'


Recently updated from Angular 12 to latest & updated respective package.json references to latest as well

Error:

 Module not found: Error: Can't resolve '@angular/platform-browser/animations' in 'C:\MySolution\AngApp\Client\AppName\src'

I'm using Yarn & Gulp with webpack in combination.

Update 1: Sample Test App everything works as expected but when i work on Real application i get the above error.

I suspect something to do with Gulp how it does things any advice would be helpful.

Happy to add more details if required.


Solution

  • Fixed the issue:

    Root Cause: Angular.json having a extra brace causing this whole mess somehow earlier webpack seem to ignore this. Error thrown is irrelevant to what's happened in real.

    Updated Yarn to 3.2.4 & WebPack to 5.74