22 Dec 2010
15 Feb 2014
Link to this post
In the last 6.3 release, Sitefinity is automatically loading RequireJS on every page by default. The problem is that now when you load ANY AMD-complaint library, such as Kendo, MomentJS, Lo-Dash, etc, your page will not know it’s there unless you use RequireJS to extract it. In other words, many people right now are loading libraries into their Sitefinity site and are completely baffled as to why they can’t find or use the script in code as if they never loaded it.
See the attached screenshot. I added MomentJS on the bottom of the page, but can’t use it because MomentJS said, "Oh you have RequireJS on the page, I’m going to load as define(..) and call me when you need me via require." But say I have no idea what RequireJS is, I’ll be wondering why I can’t use "moment" if it is clearly loaded in the HTML. A very frustrating bug to them they will never figure out unless they know about RequireJS, even if you know RequireJS still frustrating because no one knew Sitefinity snuck RequireJS in the latest build which is buried in the embedded scripts.