Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Loading chai plugins along requirejs gives mismatch error #3

declandewet opened this Issue · 21 comments

This only happens if I load sinon-chai, chai-as-promised or jquery-chai:



Are you sure you've placed requirejs in karma.conf.js before chai and plugins as in readme?


Yeah - I made sure to do that.



Please check if issue in resolved in 0.2.0


It's not fixed. I am experiencing the same issue.

When trying to load both, chai-jquery and chai-things as plugins, I get the same error message as above.

If I use only chai-jquery, the error becomes much stranger. IE11 will still emit the dependency mismatch error:

IE 11.0.0 (Windows) ERROR
        Mismatched anonymous define() module: function ($) {
              return function (chai, utils) {
                return chaiJquery(chai, utils, $);
        at C:/Users/patri_000/Documents/Projekte/jidejs/jidejs/node_modules/requirejs/require.js:141

The other browsers will "work" except that chai-jquery won't be loaded expect(...).to.have.class(...) points out that there is no such thing as a class function.

Could that be related to the fact that chai-jquery already supports AMD when you're wrapping it in a define?


I'll look into this, thanks.


I can confirm that I also have this issue with ~0.2.0



@princed princed added this to the 1.0 milestone

Any updates?


Could someone provide a clean testcase?


Whoa, thanks


I can't use chai-as-promise at all, because I use requireJs.
Any updates?


I have the same issue on Windows, but the weird thing is that it works fine on Linux. You can reproduce by checking out and running grunt. The package versions on that repo are a bit old but it's still failing after running npm-check-updates -u as of today.


I have created a pull request to fix this.


Anyone has ever figured out solution for this? Seems to be very old issue.


Pull request have been submitted for this issue.


Should be fixed in 0.5.0, thanks @unional

@princed princed closed this
@princed princed removed this from the 1.0 milestone
@fmayer-tstllc fmayer-tstllc referenced this issue in kmees/karma-sinon-chai

Getting 'Mismatched anonymous define()' #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.