ktalarico Posted July 31, 2019 Share Posted July 31, 2019 We are using a custom dashboard hyperlink handler taken from here: https://community.jaspersoft.com/wiki/how-use-custom-hyperlink-handler-dashboard-tibco-jasperreports-serverAfter upgrading to 7.2, we are getting the following error in the browser console and the dashboard fails to load:Error: Mismatched anonymous define() module: function(require)I have consulted https://requirejs.org/docs/errors.html#mismatch and I feel like I followed the solution but it did not help.The problem seems to be related to the order in which javascript modules are being loaded.The error does not happen consistently. I can execute dashboards several times in a row without error before it happens.I understand that RequireJS is a JavaScript file and module loader, but I know very little about javascript; so any suggestions for the layperson are welcome.The custom handler code is below.//define(function(require) {define(["require","jquery", "underscore"], function(require) { "use strict"; var $ = require("jquery"), _ = require("underscore"); return { events: { click: function(event, linkData) { if (window.location.href.indexOf("dashboard/viewer") > -1) { var hashParts = window.location.hash.split("&"), reportUri = hashParts[0], params = {}; for (var i = 1; i < hashParts.length; i++) { if (hashParts[i].indexOf("=") > 0) { var key = hashParts[i].split("=")[0], value = hashParts[i].split("=")[1]; if (key in params) { params[key].push(value); } else { params[key] = [value]; } } } location.replace(reportUri + "&" + $.param(_.extend(params, linkData.parameters), true)); } } } }}); Link to comment Share on other sites More sharing options...
ktalarico Posted November 7, 2019 Author Share Posted November 7, 2019 Solution provided by Tibco support:Our engineering team investigated this and says that the issue seems to be caused by some strange behavior in require.js. They say that the issue can be fixed by adding the module name in dashboardHyperlinkHandlerUpdateDashboardParams.js like this: replace define(function(require) {with define("dashboardHyperlinkHandlerUpdateDashboardParams", function(require) { Link to comment Share on other sites More sharing options...
ktalarico Posted November 7, 2019 Author Share Posted November 7, 2019 Note that other times you will get a jquery error: jQuery.Deferred exception: s is not a constructor TypeError: s is not a constructor[/code]Solution below resolves both Link to comment Share on other sites More sharing options...
kkumlien Posted November 7, 2019 Share Posted November 7, 2019 Thanks for sharing this and for updating https://community.jaspersoft.com/wiki/how-use-custom-hyperlink-handler-dashboard-tibco-jasperreports-server ! I upvoted question and answer :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now