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

Time:10-26

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.

CodePudding user response:

import this module from angular to app.module

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

imports: [BrowserAnimationsModule]

CodePudding user response:

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

  • Related