-
Notifications
You must be signed in to change notification settings - Fork 240
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
Error Mismatched anonymous define() module #1018
Comments
It's only IE 11. |
Which script snippet are you using? |
|
I'm also experiencing this error, but it's not browser specific. I got the error when upgrading applicationinsights from version 1.0.20 to 2.2.2. |
@Maus3rVonDutch Can you explain how you are importing and setting up the SDK? You shouldn't need to grab the SDK from the CDN since you seem already be using the npm module which contains the SDK as an ES6 module. This is a difference from 1.0.20, which did not include the modules (the sdk entry point was |
Hi @markwolff , Thnx for the reply. In this case we are using the snippet setup:
NB we currently have 2 different implementations, one for legacy code (snippet setup) and an intergrated NPM setup for an AngularJS solution. NB the legacy pages contain some requireJS with plain vanilla JS/Telerik kendo code. Some legacy pages also contain a mix of both, so vanilla JS (requireJS) code and some code (or hacks) to supply some AngularJS features (which as packaged the npm setup with webpack). Could it be that the latter creates the conflict? |
Im also experiencing the same problem upgrading from v1 to v2.(at time of writing). Im testing on Windows 10 Chrome Version 77.0.3865.90 (Official Build) (64-bit)/ Microsoft Edge 44.18362.329.0. The first load of the page in a new session/window would work, the subsequent reloads of the page/site would fail. Sometimes a HARD RELOAD of the page would make it work again. Firefox seemed ok and couldnt reproduce error. Also tested IE11 and would get it the error, not as often. It would work on a fresh page session, then if i reloaded page i get the define error, if i do a HARD RELOAD of the page to clear cache it would mostly work, sometimes not. Snippet used first tag inside
The requirejs (v2.3.5) script tag and other scripts tags are at the end of the
|
We are also seeing this issue after updating AppInsights JS instrumentation. |
I’m sorry, I forgot to followup on this issue. |
We only have a snippet implementation, and our case is very similar to what @madaz describes above. We see this happening randomly on latest versions of IE, Firefox and Chrome. Hard reload helps. |
@markwolff we need to use the requirejs pattern because of the way we inject micro frontends. I have create a repo with example of problem, i was getting the error in Chrome 78 at the time of authoring example. https://github.com/madaz/microsoft-ApplicationInsights-JS-Issue-1018 would appreciate your help on this. thanks |
Seeing the same behavior that @joonakokkola is describing as well. We have just the snippet and it occurs randomly for users but constantly when trying to run an automation test in the browser. |
If anyone is wondering and does want a workout on this, the script that the app insights snippet was referencing was: I was able to pull down a local copy and change the following in the JS to have a named define: Changed this inside of the file Not sure if this is the best fix but we are no longer seeing the error. Thanks. |
@markwolff Is this issue on your radar? This is blocking us from upgrading to v2 |
@madaz Sorry for the delay. I'll add it to my queue and look into it when I get the chance! |
Hey, we've also run into this issue. Currently we're looking at a workaround involving ShawnC7208's comment. Is this still on anyone's radar? |
We are also facing this issue. From the require.js documentation: "MISMATCHED ANONYMOUS DEFINE() MODULES ..."
I guess this is what is happening here and what @ShawnC7208 mentioned. Any update on this @markwolff ? |
We just ran into this error as well. My workaround was to use a hard-coded script tag to JS on the CDN, then to load AppInsights manually and set it against
The trick is to force the app insights code to run before the requirejs code runs, hence this code all code is in the |
We run into the same problem, on our legacy RequireJS pages. We do use the inline script snippet, but after updating to the latest one, we get the same I decided to use the latest snippet, but use the older Any update on a fix @markwolff ? |
To address this we are planning on publishing a common js (cjs) version to the CDN and thus avoid the requirejs issues and the described work arounds / hacks (such as undefining and redefining define or attempting to load before requrejs is) The only required change will be to reference the cjs version as the URL for the snippet, this will be The PR for this is #1352 |
- Also publish an iife module format to skip the define loading
We are also going to publish a set of iife formated files to the CDN as well as the cjs versions really only solve the issue if you want to load it as a module. So the new URL (once v2.5.8 is fully deployed) will be |
v2.5.8 is now fully deployed This includes the new endpoint file https://az416426.vo.msecnd.net/scripts/b/ai.2.gbl.min.js |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Dear,
I have a angularjs + requirejs website, I use Pasting a script snippet at the tag for monitor. but some boy is error when he access this view. It's only the first access on new tab.
The text was updated successfully, but these errors were encountered: