RequireJS Error

Status
Not open for further replies.

degarrin

Member
Hello. I've run across the following error on my site:

Uncaught ReferenceError: requirejs is not defined​

It only causes problems with a few extensions I am using in relation to adding dates (see the attached image for code error), and I finally narrowed it down to a conflict with Fabrik. I tried using firebug to trace the exact location of the issue, without luck, but then I found reference to requirejs in components/com_fabrik/jhelpers/2.5/behavior.php on line 669 and of course in media/com_fabrik/js/lib/require.js. And unfortunately it seems to be integral to Fabrik, because it appears to be hooked into the main system plugin.

I really am not that good yet with Javascript, but I looked at requirejs.org to see if it was something I could figure out, but no luck unfortunately and I didn't see anything in the forums. I don't really know what to do to fix the problem. Does anyone have any suggestions?

I recently upgraded Fabrik to 3.1rc2 but am still on Joomla 2.5.17 (for a little while longer).

Thank You
Angela
 

Attachments

  • requirejsnotdefined.JPG
    requirejsnotdefined.JPG
    131.4 KB · Views: 437
It could be an issue with F3.1 and J2.5 (which has not had nearly as much testing / usage as F3.1 with J3). Or it could be something else.

Please let us have a link to your site so we can look at the HTML generated. But there should be a <script> tag on the page to load /media/com_fabrik/js/lib/require/require.js.
 
The main site is www.degarrin.net. Unfortunately the specific pages that are showing the javascript error are restricted member access pages, but I can PM a login/password and the direct url to someone if necessary. However, I did go ahead and check out some of my site page source files<script> tags to see if /media/com_fabrik/js/lib/require/require.js was loading as you mentioned and I did not see it on any of them either.
 
Well - it is the same code in \components\com_fabrik\helpers\html.php lines 935-974 that inserts the loading of require.js as creates the lines that call it. So no idea why it is not working - and since this is so core to Fabrik's operations I cannot believe that it doesn't work in any J2.5 installation, and it seems more likely to be a quirk of yours.

If you don;t want to give out credentials, you could create a simple Fabrik page on your site which doesn't do anything important. Either way I will take a look at the HTML, but I would guess that it will need Admin access and maybe FTP access and probably a significant amount of time to diagnose fully.
 
My apologies, I don't think I explained well. I am not getting the error on pages where I have anything built with Fabrik (see http://www.degarrin.net/contact-us). I'm actually getting the error on pages built with other extensions that don't even use require.js and Joomla's built-in "Create Articles" option.

I'll be glad to give the credentials and if it is something that is going to require support outside the scope of the norm just let me know.
 
I'll take a look - though since I am a user providing help on a voluntary basis, there is no real norm.
 
Well - looking at the first link member-services/article-creation I can see the error, but at first sight (without disabling fabrik to check) it doesn't look like a fabrik issue at all. Although fabrik does use requirejs, I think this is just co-incidence as the javascript code that is wrapped in the requirejs does not look like anything to do with fabrik - just to do with the use of calendar fields on the page.

The other two pages have identical errors around calendar fields.

My best guess is that it is a problem caused by another extension, possibly conflicting with fabrik but that seems less likely, and you should disable a load of extensions not needed on these pages and see if that fixes it, and if so, re-enable them one by one until you find the one that is causing the problem.
 
Sorry for not responding more quickly, I was a bit under the weather and just saw your posts. Thank you Sophist, for taking the time to look at my site and help me out. And thank you Rob, for fixing the problem. Appreciate it!

Angela
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top