-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Type 'ReactPlugin' is not assignable to type 'ITelemetryPlugin' #32
Comments
@Karlie-777 can you have a look at this please, the only change that I'm seeing to the interface is the optional core, which should not cause this issue. It may be some combination of tsconfig.json settings (ie. strict etc). |
Here's my tsconfig.json: {
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
} |
@slavanga just want to double confirm that the error happened when you are using React Plugin not ReactNative Plugin right? it seems that in your config, React plugin is used and the error is ReactNativePlugin related |
@Karlie-777 I just checked again and the error is indeed about React Plugin: Title and original message updated. |
@slavanga try to add |
@Karlie-777 Adding the option in tsconfig.json did not solve the issue. |
Confirming. @microsoft/applicationinsights-react-js 3.4.0 depends on @microsoft/applicationinsights-core-js 2.8.5 Both versions of @microsoft/applicationinsights-core-js are incompatible on TelemetryUnloadReason type
Using @microsoft/applicationinsights-react-js 3.4.0 with @microsoft/applicationinsights-web 2.8.5 works regards, |
Now that is "really" weird as the last change to this enum was on Mar 31st, 2022 which was released with 2.8.0... This sounds like typescript not sorting out that the Which versions of typescript are you all using? |
See microsoft/ApplicationInsights-JS#1837 for previous suggestions on this. |
@MSNev Changing the settings |
Tested with 4.6.2 and 4.9.4. I can't share my package.json and lock as is. I'll try to find a minimal reproduction case. |
I think #31 will fix resolve the type error which is cause (I believe) because of an optional change we made to a base interface. As we are planning to release 2.8.10 shortly (next week), there will be an additional bump to 2.8.10 before we release an updated version of this plugin (which should also be next week) |
[5471](https://dev.azure.com/amido-dev/Amido-Stacks/_workitems/edit/5471) - bump app insights web patch version to resolve linting - microsoft/applicationinsights-react-js#32 - update ts config to resolve linting
Hi, I'm currently still facing the same error with the version below. I have tried the solution provided above but still not able to resolve.
The error I get:
|
How far are we on this topic? There was just released new versions the packages without a fix?
|
So based on https://github.com/microsoft/applicationinsights-react-js#compatibility-matrix with the matching versions there should not be any issues as far as we are aware. Additionally, We plan to release additional versions of "@microsoft/applicationinsights-react-native": with new versions based on this discussion around the May timeframe as we are now continuing to upgrade our (currently) non-public components to the new v3.x verison of ApplicationInsights. |
Ok, the above triggered a memory and I've just applied the same work-around we had to do for the CI pipeline. I've kicked off the nightly build job so it should produce something in the next hour or so -- we still need to "fix" the |
😢 The "workaround" didn't work so needs more investigation |
Not to cause too much spam, but facing the issue on NextJS FE: /@microsoft/applicationinsights-react-js - v3.4.3 tsconfig:
|
Hi, I'm facing the same issue. I'm using the following: But getting the following error: |
Unfortunately, doesn't work anymore with Typescript v5.0 |
We should be releasing an updated version of this plugin (which will call v17 -- to align with the major version number of React) with full support for AI v3.x (which should (hopefully) resolve these specific issues -- although we have not performed any TS 5.x tests) -- probably by the end of next week (if not before) |
May i know is there any recent update on this ? |
We are planning on creating these releases this week. |
try |
Any updates on this issue and the releases for it? @MSNev @siyuniu-ms |
@muchai-mercy The issue is caused because we're using Application Insights JS as a dependency and there is some type conflicts caused by that. We'll wait until the AI JS v3.0.3 is updated, planned for next week. Once that update is done, this issue will be unblocked and fixed. |
fixed at #57 |
@siyuniu-ms I have applicationinsights-react-js": "17.0.3", applicationinsights-web": "3.0.7" and the issue still exists. |
Confirmed (broken) on @microsoft/applicationinsights-react-js: 17.0.3, @microsoft/applicationinsights-web: 3.0.8. Interestingly, I didn't get this with 17.0.3 / 3.0.7. Reverting back to 3.0.7 builds correctly. NGL, I hate these issues... |
Thanks @jarosik10 and @daggmano for bring it up. We are making a fix for it in our next release which I believe will help solve the problem from the root. A potential workaround could be to set skipLibCheck to be true in the config. |
Just got the update for applicationinsights-react-js to 17.0.4, and with applicationinsights-web 3.0.8, everything is gold! Thanks so much. |
@siyuniu-ms @MSNev we received the
again. Works: "@microsoft/applicationinsights-react-js": "17.1.0",
"@microsoft/applicationinsights-web": "3.1.0", Doesn't work: "@microsoft/applicationinsights-react-js": "17.1.0",
"@microsoft/applicationinsights-web": "3.1.1", TypeScript version is |
Hi, thanks for the info. We have not updated the React dependency on Application Insights to version 3.1.1, and that could be causing the type problem. The error should go away after we release version 17.1.1. We are also working on solving the root cause of the problem. In the meantime, please continue using the same minor version to avoid the type error. Thanks. |
@siyuniu-ms can you please create the release updating this -- these are annoying as they are now always referencing the same packages (no longer embedding them). We will also need to investigate further, as these are purely TypeScript complaining, as functionally they are compatible. |
Appreciate the reply. Don't have an issue with waiting :). Was just a bit confused because the compatibility matrix says |
@p-hlp Hi, 17.1.1 is now publish. |
A type error similar to issue microsoft/ApplicationInsights-JS#1324 has appeared in the latest versions:
Type 'ReactPlugin' is not assignable to type 'ITelemetryPlugin'.
Versions:
Here's the simplified example from my next.js app:
The text was updated successfully, but these errors were encountered: