TrilonIO/angular-application-insights

Angular 11 incompatible

vdavyskiba opened this issue · 4 comments

"@markpieszak/ng-application-insights": "8.0.3",
npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: web@0.0.0
npm ERR! Found: @angular/router@11.0.2
npm ERR! node_modules/@angular/router
npm ERR! @angular/router@"^11.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/router@"^10.0.0" from @markpieszak/ng-application-insights@8.0.3
npm ERR! node_modules/@markpieszak/ng-application-insights
npm ERR! @markpieszak/ng-application-insights@"8.0.3" from the root project

$ node --version
v15.2.0
$ npm list -g --depth 0
/usr/local/lib
├── @angular/cli@11.0.1
├── npm@7.0.10
└── nx@10.3.3

I also get this error:

This likely means that the library (@markpieszak/ng-application-insights) which declares ApplicationInsightsModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Sounds like need to be simply recompiled with new compiler and Ivy.

Add the following to your package.json:

{
  "scripts": {
    "postinstall": "ngcc"
  }
}

If you already have the latest version of this package, run npm run postinstall after you added above.

Fixed via cae052a and published to npm as v9.0.0 version, apologies for the super long delay! :(

Works at it should now, and the Angular CLI simply throws a warning on build since we're using an underlying commonJS/AMD package (from microsoft)

image

Otherwise we're all set! Thanks again for your patience.

I spent most of today digging through source-map-explorer output to find that this package was preventing the optimization, only to see you updated the package today! Thanks so much!

EDIT I'm still getting the CommonJS warning and optimization bailouts 😕. This package causes the main production build bundle to grow ~260KB.