# Requirejs with Elasticsearch Angular app throwing "lib/connectors/angular" has not been loaded yet for context: \_. Use require(\[\])

**URL:** <https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-lib-connectors-angular-has-not-been-loaded-yet-for-context---use-require/23534>\
**Category:** Elasticsearch\
**Created:** [May 4, 2015, 9:59am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-lib-connectors-angular-has-not-been-loaded-yet-for-context---use-require/23534 "2015-05-04T09:59:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithyanand](https://avatars.discourse-cdn.com/v4/letter/n/e19adc/32.png) [@Nithyanand](https://discuss.elastic.co/u/Nithyanand)\
**Post date:** [May 4, 2015, 9:59am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-lib-connectors-angular-has-not-been-loaded-yet-for-context---use-require/23534/1 "2015-05-04T09:59:12Z")

</div>

I am trying to build Elasticsearch Angular app. I am using require.js.

main.js

require.config({

paths : {  
'angular' : '../bower\_components/angular/angular',  
'elasticsearch' : '../node\_modules/elasticsearch/src/elasticsearch.angular',  
'app' : 'app',  
'coreModule':'coreModule',  
'esClient' : 'service/esClient'  
},

shim : {

'app':{  
'deps' : ['angular','coreModule']  
},

'coreModule' : {  
'deps' :['angular', 'elasticsearch','esClient']  
},

'esClient' : {  
'deps' :['angular', 'elasticsearch']  
}

}

});

require(['app'], function(){

angular.bootstrap(document, ['app']);  
});

esClient.js

define(function(){

var esClient=angular.module('esClient', ['elasticsearch']);

esClient.service('client', function (esFactory) {  
return esFactory({  
host: '[http://localhost:9200](http://localhost:9200)',  
apiVersion: '1.5',  
log: 'trace'  
});  
});

});

* * *

But it is throwing the following errors. Anyone else faced this issue?

Uncaught Error: Module name "lib/connectors/angular" has not been loaded  
yet for context: \_. Use require([])  
[http://requirejs.org/docs/errors.html#notloaded](http://requirejs.org/docs/errors.html#notloaded)  
makeError @ require.js:166  
localRequire @ require.js:1407  
requirejs @ require.js:1752  
(anonymous function) @ elasticsearch.angular.js:7  
coreModule.js:3 coreModule module  
app.js:4 App module  
angular.js:63 Uncaught Error: [$injector:modulerr] Failed to instantiate  
module app due to:  
Error: [$injector:modulerr] Failed to instantiate module coreModule due to:  
Error: [$injector:modulerr] Failed to instantiate module esClient due to:  
Error: [$injector:modulerr] Failed to instantiate module elasticsearch due  
to:  
Error: [$injector:nomod] Module 'elasticsearch' is not available! You  
either misspelled the module name or forgot to load it. If registering a  
module ensure that you specify the dependencies as the second argument.

PS : I previous used bower installed elasticsearch. Now using npm install.  
Hence the updated comment.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7446c914-3e4c-4183-8399-cc72d436b8b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7446c914-3e4c-4183-8399-cc72d436b8b7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:15am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-lib-connectors-angular-has-not-been-loaded-yet-for-context---use-require/23534/2 "2017-07-06T00:15:55Z")

</div>


