-
Notifications
You must be signed in to change notification settings - Fork 244
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
ApplicationInsights-JS latest version 3.1.1 giving TypeError: Cannot read properties of undefined (reading 'getCrypto') #2307
Comments
I encountered the same issue and the only quick solution that worked for me, was to manually revert
back to the exact version This works for me together with |
@goodnic Thanks for sharing, it worked for me also. |
Same issue. |
Same issue for us too |
@siyuniu-ms can you please investigate why we are getting interface issues as they should be compatible. And as a temporary workaround please push out a release with the updates |
Also please investigate why we are getting As we didn't change this, so it seems like the runtime doesn't include something that the code is assuming |
The I have solved this by installing fixed versions i.e. pnpm install @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] |
We have the same problem and unfortunately this suggestion does not work for us, even if I explicitly install all packages with version 3.1.0. It looks like the |
On my side with that in my
|
nice this seems to fix my issue. thanks |
hi @gary-rusher @Garima-github-24 @goodnic @p2s @benrhere @robrorijeloxia @mburumaxwell |
Hi @siyuniu-ms , I think you're referring to "microsoft/applicationinsights-angularplugin-js" receiving a new version. I'm not referencing this package. (I'm directly referencing "@microsoft/applicationinsights-web" and "@microsoft/applicationinsights-react-js". I've run |
Hi, we also did a quick fix for react-js, the current version is 17.1.1. Could you check whether that helped solve your problem? |
Hi again, yes, the problem persists with applicationinsights-react-js 17.1.1. Just to confirm, I show that as released 5 days ago, |
@benrhere Thanks for checking. I will look into it. |
Looking at the code for this part of the trace Uncaught TypeError: Cannot read properties of undefined (reading 'getCrypto')
at random32 (RandomHelper.js:57:13) This maps to the following code What I suspect is occurring is that your packaging system is "referencing" the loaded "module" to the above is becoming something like
Either way, I believe that this part of the exception is due to your packaging system and/or dependency issues. And if your still getting the TypeError with v17.1.1 then this even further suggests (to me) that somewhere in your dependency stack there is a mismatch of versions or perhaps even multiple versions. I'd start by performing a full clean and checking your package-lock (or equivelent), it may also be some sort of mismatch where your packages (if your exporting the global namespaces As part of v3.x when loading from the CDN, we added some additional "debugging" objects during initialization and we also "set" 2 namespaces |
@siyuniu-ms Yesterday we got below issue after installing the latest version 15.1.1: For the time being we have reverted @microsoft/applicationinsights-angularplugin-js to 15.0.1 and @microsoft/applicationinsights-web to 3.0.7 to get our application running. |
I tried version 15.1.1 of the @microsoft/applicationinsights-angularplugin-js package but it seems there is another error, it can't find the |
Looking at the internal office build system, yes, it appears that it did not generate the correct output, resulting in the above. (missing esm2020, fesm2015 fesm2020 folders :-( ) |
I've just "fixed" the build pipeline (to generate the *.tgz from the correct folder again), however, we are currently having an infrastructure issue which is blocking the "re-generation" of the build structure -- I don't have a timeline at this point. @siyuniu-ms can you please prepare (release PR) for 15.1.2, as we won't be able to delete / replace the existing 15.1.1. I'll see if the infra is able to mark 15.1.1 as "bad". |
Ok, I've deprecated 15.1.1, tagged as "invalid" and promoted 15.1.0 back to the latest. |
Anyone with Angular 17 has achieved to make it work? If so, what packages did you install? I'm unable to make it work, I've tried all the solutions in this issue 😅 |
Unfortunately not, I have also tried all solutions (although we are using Angular 15, but I don't think this changes much). |
This issue is making VSCode extension development challenging due to a transitive dependency through |
Hi, can you try use 15.1.0 angular with 3.1.0 applicationinsights-web? |
No as this will cause other published dependent packages to fail because of the required version.
This would also cause issues due the above as it would revert some functions that are required for the related packages, (this basically represents forward compatibility -- components "wanting" to use a newer version but working with older core versions -- we don't support this as we can't guarentee that all "future" interfaces / functions already exist in the current version -- because they don't exist yet). In 3.1.1 we did add some additional functions / interfaces, but they were all created as backward compatible (all older interfaces / functions still exist) And at the moment, our infrastructure pipeline (for releases) has some challenges which is blocking our ability to release anything (we are escalating this to try and get releases (specifically the angular release) to address this extremely annoying issue with 15.1.1. If your environment you should be able to either (as a short-term workaround)
|
on the function random32(signed) {
var value = 0;
var c = (0,_EnvUtils__WEBPACK_IMPORTED_MODULE_1__.getCrypto)() || (0,_EnvUtils__WEBPACK_IMPORTED_MODULE_1__.getMsCrypto)(); So the issue is occurring (for them ) because the webpack required "bundle" Has anyone been able to identify a root cause as to why webpack is failing to load / run the instances? |
For the |
@bwateratmsft @div-42 @Jase7 This will at least make the angular app to build and work. |
Tagging as an issue that (should) be fixed in v3.1.2, where the linked issue #2306 should address the |
Problem persists for
|
Yes, it should be but because of both the |
Hi,
I am using ApplicationInsigts-JS SDK version in my angular application. Recently I updated my packages (which updated ApplicationInsights-JS to 3.1.1) and then the application starts breaking with the below error:
Uncaught TypeError: Cannot read properties of undefined (reading 'getCrypto')
at random32 (RandomHelper.js:57:13)
at newId (RandomHelper.js:119:18)
at 62304 (DataCacheHelper.js:13:31)
at webpack_require (runtime.js:23:42)
at 68323 (ConfigDefaults.js:171:1)
at webpack_require (runtime.js:23:42)
at 29513 (DbgExtensionUtils.js:48:1)
at webpack_require (runtime.js:23:42)
at 54984 (EventHelpers.js:481:1)
at webpack_require (runtime.js:23:42)
I also tried to revert to previous stable version 3.0.7 and reverted the dependent lib @microsoft/applicationinsights-angularplugin-js to 15.0.1 but then it's giving me other dependent lib issue : Type 'AngularPlugin' is not assignable to type 'ITelemetryPlugin'.
Types of property 'setNextPlugin' are incompatible.
Kindly let me know how I can resolve this issue.
The text was updated successfully, but these errors were encountered: