Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Loading chai plugins along requirejs gives mismatch error #3

Closed
declandewet opened this Issue · 21 comments
@declandewet

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

image

@princed
Owner

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

@declandewet

Yeah - I made sure to do that.

karma.conf.js.frameworks

@princed
Owner

Please check if issue in resolved in 0.2.0

@pago

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, $);
              };
            }
        http://requirejs.org/docs/errors.html#mismatch
        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?

@princed
Owner

I'll look into this, thanks.

@solatis

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

@Phoscur

+1

@princed princed added this to the 1.0 milestone
@mikach

Any updates?

@princed
Owner

Could someone provide a clean testcase?

@princed
Owner

Whoa, thanks

@Efimster

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

@RenaudF

I have the same issue on Windows, but the weird thing is that it works fine on Linux. You can reproduce by checking out http://github.com/renaudf/scaffold-frontend.git 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.

@unional

I have created a pull request to fix this.

@pankajkumar

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

@unional

Pull request have been submitted for this issue.

@princed
Owner

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
Open

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.