Tender breaks Javascript on pages with require.js

David Baumgold's Avatar

David Baumgold

15 Oct, 2013 02:21 PM

Your tender_widget.js file does some checking to see if the page has an AMD-compatible define() function available in the Javascript environment. If so, it defines a "domready" module, but doesn't actually use it. As a result, the Javascript breaks with "Uncaught ReferenceError: domready is not defined" and "Uncaught Error: Mismatched anonymous define() module". Can you fix this?

  1. 1 Posted by Julien on 15 Oct, 2013 04:58 PM

    Julien's Avatar

    Hi David,

    This should be fixed now. Can you check?


  2. 2 Posted by David Baumgold on 15 Oct, 2013 05:11 PM

    David Baumgold's Avatar

    Yes, it seems to work now. Since this script has the potential to break our production application, we're considering simply downloading a copy and serving that static copy to our users, rather than relying on your script. What's the least-risky way of handling upgrades to your APIs?

  3. 3 Posted by Julien on 15 Oct, 2013 05:35 PM

    Julien's Avatar

    Hey David,

    Sorry about the error. I updated a lib and didn't notice it switched to a module format.

    We rarely update the widget, and aside from domready which allows to avoid bigger dependencies to execute code when the DOM is ready, the widget code is pure JS and has no other dependencies. We test changes in most browsers before deploying to avoid errors, but I must admit I missed the require.js conflict, since we don't use it. That is really an edge case, and now that I'm aware of it, it won't happen again (the version of domready we use works well as is, the update was not needed, so we can keep that version indefinitely).

    If you want to host the widget on your site, you should host it on the same domain as your support site, as we use the host in the code to find the matching Tender. When it comes to API updates, the widget doesn't really use the API and all it does is load an iframe, so there isn't much change going on JS side. We still do small changes from time to time, but it's 99% styling to the popup, and it's pretty rare. So you could easily check your version against ours every few months.

    I hope that answers your question/concerns.

  4. Julien closed this discussion on 18 Oct, 2013 09:50 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac