Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Uncaught Error: Mismatched anonymous define() module #7

Closed
pwistrand opened this issue Jan 16, 2014 · 8 comments
Closed

Uncaught Error: Mismatched anonymous define() module #7

pwistrand opened this issue Jan 16, 2014 · 8 comments

Comments

@pwistrand
Copy link

I'm trialling gulp-karma with the same karma.conf.js file that we use for our existing grunt karma task and running into issues. Following the suggestion to explicitly specify plugins to solve Error: No provider for "framework:jasmine" [https://github.com//issues/4] I'm now receiving an "Uncaught Error: Mismatched anonymous define() module: function (... " error message for every spec.

I can see from debugging in chrome that none of our Spec dependencies (jquery, underscore etc) as defined in our test-main.js file are being loaded. Other than learning the internals of require.js I'm stuck.

@lazd
Copy link
Owner

lazd commented Jan 16, 2014

I'm unfamiliar with using RequireJS in the context of Karma. However, I could see how this might be affected by Karma being unable to automatically discover its plugins. Can you please try gulp-karma@0.2.0 and see if your issue is fixed?

@pwistrand
Copy link
Author

Same issue with gulp-karma 0.0.2 unfortunately

@lazd
Copy link
Owner

lazd commented Jan 26, 2014

@pwistrand, can you push a repo that reproduces this? That'll make it easier for me to debug it.

@khepin
Copy link

khepin commented Jan 28, 2014

See there: https://github.com/khepin/gulp-karma-failing

If I pipe in non-existing files it works. Probably because the source files don't get overwritten in karma's configuration. If I pass in existing files, it breaks.

@tonyhb
Copy link

tonyhb commented Mar 9, 2014

+1. The issue is duplicated specs or required files from both Gulp and Karma. If you pipe in files from Gulp which are also included in your Karma files directive you'll get mismatched errors.

The only fix right now is to define your files in karma.conf.js and pipe in an undefined.js file like this: https://gist.github.com/tonyhb/9454371#file-gulpfile-js-L44. You have to pipe something in to get Karma working with Gulp. Just make sure it's a file that doesn't exist.

@tonyhb
Copy link

tonyhb commented Mar 9, 2014

Looks like it's also the same as issue #9 and #18?

@tony
Copy link

tony commented Mar 28, 2014

@tonyhb : That fix did the trick for me.

Yes there is overlap between the errors here and how gulp-karma handles this situation.

@NicoleY77
Copy link

@tonyhb it works, thank you

@lazd lazd closed this as completed Oct 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants