Using 3rd party libraries in requireJS dashboards

49 views
Skip to first unread message

Dan

unread,
Aug 30, 2018, 3:47:32 AM8/30/18
to pentaho-...@googlegroups.com
Hi,

I have a problem with our dashboards which rears it's head repeatedly in internet explorer and causes the page to fail to load.

The error is:

SCRIPT5022: Script error for: jquery http://requirejs.org/docs/errors.html#scripterror
File: requirre.js, Line: 8, Column: 137

I don't really know why this doesn't happen in chrome, and it doesn't always happen in IE. Funnily enough, it doesn't happen for all of our developers, only some of us!  Even odder, it comes and goes.  So I assume it's a timing issue, and IE makes it more obvious, and I'm guessing it could happen in chrome too.

The cause of the error is a JS library we use called summernote.  Remove this library and everything loads normally.  At the moment it's just referenced in the layout section of CDE as a JS file resource.

This led me to thinking - does summernote need a "shim"?  So I started down that route, which i've been down before with jeditable, I even wrote about it here:


However; Trying the same code but for summernote does not work, it gives this error:

Mismatched anonymous define() module: function($) {
}

I've put the full shim code here:


So any ideas?  As require isn't going away and lots of people are asking and having trouble with it i'd really like to get a library of solutions documented so people can migrate, and get the benefit of some of the new requirejs only components which are really good.

I did also wonder if there is a problem with the really old jquery that is used by CDE, as summernote uses a newer one, but that can't be the case because everything works fine when the page successfully loads, and again - it all works fine in chrome.

Thanks!
Dan


Reply all
Reply to author
Forward
0 new messages