Question
Thingworx 8.5 Uncaught Error: Mismatched anonymous define() module: [object Object]
Hello,
The following error cause a lot of problems about widget runtime:
When loading extension widgets at runtime, the libraries used by the widgets trigger the following error:
Uncaught Error: Mismatched anonymous define() module: [object Object] https://requirejs.org/docs/errors.html#mismatch
at makeError (advanced-widgets-runtime-pre.js?_v=8.5.0:168) at intakeDefines (advanced-widgets-runtime-pre.js?_v=8.5.0:1254) at advanced-widgets-runtime-pre.js?_v=8.5.0:1452
I found at the end of this article the documentation: https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Release_Notes/version8.5.0ReleaseNotes.html
This error is triggered because of the following script that loads dependency:
$('head').append('<script type="text/javascript" src="../Common/extensions/TimelineChartWidget-extension/ui/timelinechart/include/d3.v3.min.js"></script>');
To fix the error, you need to change the script as follows:
$('head').append('<script>' + 'window.defineBackup = window.define;' + 'window.define = undefined;' + '</script>' + '<script type="text/javascript" src="../Common/extensions/TimelineChartWidget-extension/ui/timelinechart/include/d3.v3.min.js"></script>' + '<script>' + 'window.define = window.defineBackup;' + '</script>');
I Tried to search in the thingworx direcotry, can you help me about this fix .
Where should I enter the corrections and how?
Thank you,
Gabriele

