microsoft / applicationinsights-angularplugin-js

MIT License
30 stars 17 forks source link

Doesn't support angular v16 #120

Open CalvinGoA opened 11 months ago

CalvinGoA commented 11 months ago

Hi there,

I got errors out when installing to an app with angular 16. Please look into it.

Thanks,

MSNev commented 11 months ago

Can you please supply more information, like

CalvinGoA commented 11 months ago

PS C:\Projects\poc> npm install @microsoft/applicationinsights-angularplugin-js npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @goa-poc/source@0.0.0 npm ERR! Found: @microsoft/applicationinsights-analytics-js@3.0.2 npm ERR! node_modules/@microsoft/applicationinsights-analytics-js npm ERR! @microsoft/applicationinsights-analytics-js@"3.0.2" from @microsoft/applicationinsights-web@3.0.2 npm ERR! node_modules/@microsoft/applicationinsights-web npm ERR! @microsoft/applicationinsights-web@"^3.0.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! @microsoft/applicationinsights-angularplugin-js@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: @microsoft/applicationinsights-analytics-js@2.8.15 npm ERR! node_modules/@microsoft/applicationinsights-analytics-js npm ERR! peer @microsoft/applicationinsights-analytics-js@"^2.8.14" from @microsoft/applicationinsights-angularplugin-js@3.0.3 npm ERR! node_modules/@microsoft/applicationinsights-angularplugin-js npm ERR! @microsoft/applicationinsights-angularplugin-js@"" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\calvi\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\calvi\AppData\Local\npm-cache_logs\2023-08-25T19_51_35_470Z-debug-0.log

MSNev commented 11 months ago

Ok,

It looks like you trying to use v3 of ApplicationInsights with the angular plugin?

We have not yet released an AI v3 compatible version of the anuglar plugin yet https://github.com/microsoft/applicationinsights-angularplugin-js#compatibility-matrix, we are actively working on creating a release which is being tracked by this milestone.

We are planning to release this shortly, which will then be followed rapidly with an Angular 15 targeted version (tracked with this milestone).

If either of these still do not work with Angular 16 then we will schedule a v16 release (based on the discussion issue in the first milestone)

OzBob commented 10 months ago

@CalvinGoA I got this combination working on Angular16:

  "@microsoft/applicationinsights-angularplugin-js": "^3.0.2",
  "@microsoft/applicationinsights-web": "^2.8.13",
zhucalvin commented 9 months ago

After downgraded the version of "@microsoft/applicationinsights-web" from "^3.0.2" to "^2.8.13", and then execute:

npm i --save @microsoft/applicationinsights-angularplugin-js

Here it was the errors I received: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @calvin-demo/source@0.0.0 npm ERR! Found: @microsoft/applicationinsights-analytics-js@2.8.16 npm ERR! node_modules/@microsoft/applicationinsights-analytics-js npm ERR! @microsoft/applicationinsights-analytics-js@"2.8.16" from @microsoft/applicationinsights-web@2.8.16 npm ERR! node_modules/@microsoft/applicationinsights-web npm ERR! @microsoft/applicationinsights-web@"^2.8.13" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! @microsoft/applicationinsights-angularplugin-js@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: @microsoft/applicationinsights-analytics-js@3.0.3 npm ERR! node_modules/@microsoft/applicationinsights-analytics-js npm ERR! peer @microsoft/applicationinsights-analytics-js@"^3.0.3" from @microsoft/applicationinsights-angularplugin-js@15.0.0 npm ERR! node_modules/@microsoft/applicationinsights-angularplugin-js npm ERR! @microsoft/applicationinsights-angularplugin-js@"" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

OzBob commented 9 months ago

@zhucalvin you have one more package in your dependencies than I did.

you have "@microsoft/applicationinsights-analytics-js@3.0.3"

it says it in the message you posted. look for the words "Conflicting peer dependency"

You must decide, whether or not you need "@microsoft/applicationinsights-analytics-js@3.0.3". The message says:

npm ERR! peer ... from @microsoft/applicationinsights-angularplugin-js@15.0.0

  1. What happens if you remove it?

OR

  1. you can experiment with this combination:
  "@microsoft/applicationinsights-angularplugin-js": "^3.0.3",
  "@microsoft/applicationinsights-web": "^2.8.14",
b-johnse commented 2 months ago

version 17 also doesnt work. added the exact snippet from the readme after installing dependencies. put in my key. then attempted to ng serve. App previously loaded and worked, but now whitescreen with no console errors.