Performance Probe JavaScript error
Question

Hi,

I'm trying to integrate some JavaScript using requirejs and I get the following error:

Uncaught Error: Mismatched anonymous define() module: function (){return outsystems.internal.ProbeCore;}


https://requirejs.org/docs/errors.html#mismatch

Having done some digging, I have located the offending code in the following file: /PerformanceProbe/performanceprobe.js

if (typeof(define) !== 'undefined') {
    define([], function() {
        return outsystems.internal.ProbeCore;
    });
}


Does anybody know whether it's possible to either disable performanceprobe for a specific app, or edit the performanceprobe.js on a cloud environment?


Thanks

Solution

Hi Hui,

I was able to resolve the issue by including the require.js script like so:

$(function() {
    $.getScript("PATH/require.js", function() {
        //Require.js code here
    });
});

Hope that helps!

There's also another anonymous define in the same file:

if (typeof(define) !== 'undefined') {
    define([], function() {
        return outsystems.internal.ProbeInit;
    });
}

I was able to fix this by changing the way I included requirejs. Let me know if you need info on how.

Craig Salmon wrote:

I was able to fix this by changing the way I included requirejs. Let me know if you need info on how.

Hi Craig,

We are facing same issue, can you share your way for fixing this?


Solution

Hi Hui,

I was able to resolve the issue by including the require.js script like so:

$(function() {
    $.getScript("PATH/require.js", function() {
        //Require.js code here
    });
});

Hope that helps!

Hi Craig,

Thanks for your quick response, I tried in my application, it works, thanks a lot.

Hi Craig,

Do you have a sample OML?

Thanks,

Chris

Hi,

I'm having a very similar problem.

My error is: Mismatched anonymous define () module: function () {return OSREC.CurrencyFormatter}


I already found out where this line is (define ([], function () {return OSREC.CurrencyFormatter})), but I didn't understand how I can change the anonymous define to something that doesn't cause this problem.


Any idea?

Any help would be helpful.

Thanks,
Edgar

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.