title: Angular 13 compilation issue (Error: Importing unexpected symbol ɵɵinvalidFactory while compiling @angular/core)
body: <p>I have an Angular 13 app which was working fine until now. In one of my feature branches, I added some components and packages from another project(lesser angular version), and this compilation error started showing up:</p>
  <blockquote>
  <p>UnhandledPromiseRejectionWarning: Error: Importing unexpected symbol
  ɵɵinvalidFactory while compiling @angular/core
  at validateAndRewriteCoreSymbol</p>
  </blockquote>
  <p>After some google searches, my guess is this has to do with Ivy compatibility with some packages, but I'm kind of stuck and couldn't think of a solution and wasted lot of time. Any idea/solutions for this that anyone knows about?</p>
  <p><a href="https://i.stack.imgur.com/MP23C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MP23C.png" alt="build error" /></a></p>
  <p>This is my package.json content</p>
  <pre><code>{
    &quot;name&quot;: &quot;userportal&quot;,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;watch&quot;: &quot;ng build --watch --configuration development&quot;,
      &quot;test&quot;: &quot;ng test&quot;,
      &quot;postinstall&quot;: &quot;ngcc&quot;
    },
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@angular-slider/ngx-slider&quot;: &quot;^2.0.4&quot;,
      &quot;@angular/animations&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/cdk&quot;: &quot;^13.1.2&quot;,
      &quot;@angular/common&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/compiler&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/core&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/flex-layout&quot;: &quot;^13.0.0-beta.38&quot;,
      &quot;@angular/forms&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/localize&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/material&quot;: &quot;^13.1.2&quot;,
      &quot;@angular/platform-browser&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;~13.1.0&quot;,
      &quot;@angular/router&quot;: &quot;~13.1.0&quot;,
      &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.3.0&quot;,
      &quot;angular-ng-autocomplete&quot;: &quot;^2.0.8&quot;,
      &quot;chart.js&quot;: &quot;^3.7.1&quot;,
      &quot;date-fns&quot;: &quot;^2.28.0&quot;,
      &quot;@ngrx/store&quot;: &quot;^13.0.2&quot;,
      &quot;@popperjs/core&quot;: &quot;^2.10.2&quot;,
      &quot;angular-tawk&quot;: &quot;^0.0.4&quot;,
      &quot;bootstrap&quot;: &quot;^5.1.3&quot;,
      &quot;crypto-js&quot;: &quot;^4.1.1&quot;,
      &quot;file-saver&quot;: &quot;^2.0.5&quot;,
      &quot;hammerjs&quot;: &quot;^2.0.8&quot;,
      &quot;moment&quot;: &quot;^2.29.1&quot;,
      &quot;ng-circle-progress&quot;: &quot;^1.6.0&quot;,
      &quot;ng2-charts&quot;: &quot;^2.3.0&quot;,
      &quot;ngx-bootstrap&quot;: &quot;^8.0.0&quot;,
      &quot;ngx-dropzone&quot;: &quot;^3.1.0&quot;,
      &quot;ngx-slick-carousel&quot;: &quot;^0.5.1&quot;,
      &quot;rxjs&quot;: &quot;~7.4.0&quot;,
      &quot;tslib&quot;: &quot;^2.3.1&quot;,
      &quot;xlsx&quot;: &quot;^0.18.3&quot;,
      &quot;zone.js&quot;: &quot;~0.11.4&quot;,
      &quot;popper.js&quot;: &quot;^1.16.1&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;^13.2.6&quot;,
      &quot;@angular/cli&quot;: &quot;~13.1.3&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;~13.1.0&quot;,
      &quot;@ngrx/schematics&quot;: &quot;^13.0.2&quot;,
      &quot;@types/jasmine&quot;: &quot;~3.10.0&quot;,
      &quot;@types/node&quot;: &quot;^12.11.1&quot;,
      &quot;jasmine-core&quot;: &quot;~3.10.0&quot;,
      &quot;karma&quot;: &quot;~6.3.0&quot;,
      &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
      &quot;karma-coverage&quot;: &quot;~2.1.0&quot;,
      &quot;karma-jasmine&quot;: &quot;~4.0.0&quot;,
      &quot;karma-jasmine-html-reporter&quot;: &quot;~1.7.0&quot;,
      &quot;typescript&quot;: &quot;~4.5.2&quot;
    }
  }
  </code></pre>