Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have the following structure for "app" and "test", generally following Yeoman's layout:

app/
 ---js/(application files)
 ---css/
 ---img/
 ---lib/
     ---angular/(all angular*.js files)
 ---partials/
test/
 ---unit/
 ---main-test.js

My main-test.js is:

require({
    baseUrl:'/base/app/js',
    paths:{
        'angular' : '../lib/angular/angular',
        //'angular' : '../vendor/angular/angular',
        'resource' : '../lib/angular/angular-resource',
        //'resource' : '../vendor/angular/angular-resource',
        'mocks' : '../../test/lib/angular/angular-mocks'
 },
    shim:{
        'angular' : { 'exports' : 'angular' },
        'resource' : { deps : ['angular'] },
        'mocks': { deps : ['angular'], 'exports' : 'mocks'}
    }

I am simply trying to make a new dir, "vendor", at the same level as "app/lib", and serve angularjs files from there, after the appropriate edits for the new path in main-test.js. When I do this, I get the following error:

 Error: Module could not be loaded: angular

I cannot figure out why just changing the location of the angularjs files would cause this error.

share|improve this question
    
What you show us looks fine to me. Could it be a caching issue? If you do not know whether the answer is "yes or no" then the way to ascertain this is to clear you browser cache and reload your application. If there's no problem then it was the cache. –  Louis Nov 26 '13 at 17:39
    
I'm using PhantomJS, how do I ensure the cache is clear? –  bmw0128 Nov 26 '13 at 17:43
    
I've not used PhantomJS yet. So I don't know. You don't have the means to load your application in a browser besides PhantomJS? –  Louis Nov 26 '13 at 17:50
    
Found the issue, I need to edit karma.conf.js accordingly for the new location of the files, duh! –  bmw0128 Nov 26 '13 at 17:52
    
Yeah, I thought it was one of those "oops, I forgot to...". Been there, done that. :) –  Louis Nov 26 '13 at 18:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.