Loading chai plugins along requirejs gives mismatch error #3

Closed
declandewet opened this Issue Nov 3, 2013 · 21 comments

Comments

Projects
None yet

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

image

Owner

princed commented Nov 3, 2013

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.

karma.conf.js.frameworks

Owner

princed commented Feb 4, 2014

Please check if issue in resolved in 0.2.0

pago commented Feb 25, 2014

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?

Owner

princed commented Feb 26, 2014

I'll look into this, thanks.

solatis commented Feb 28, 2014

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

Phoscur commented Apr 9, 2014

+1

@princed princed added this to the 1.0 milestone Apr 9, 2014

mikach commented Apr 25, 2014

Any updates?

Owner

princed commented May 5, 2014

Could someone provide a clean testcase?

Owner

princed commented Jun 17, 2014

Whoa, thanks

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

shumkov commented Sep 10, 2014

👍

+1

RenaudF commented Dec 18, 2014

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 commented Feb 25, 2015

I have created a pull request to fix this.

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

unional commented Mar 4, 2015

Pull request have been submitted for this issue.

Owner

princed commented Apr 3, 2015

Should be fixed in 0.5.0, thanks @unional

@princed princed closed this Apr 3, 2015

@princed princed removed this from the 1.0 milestone Apr 3, 2015

@fmayer-tstllc fmayer-tstllc referenced this issue in kmees/karma-sinon-chai May 4, 2015

Closed

Getting 'Mismatched anonymous define()' #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment