# Requirejs with Elasticsearch Angular app throwing Uncaught TypeError: \_.extend is not a function

**URL:** <https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-uncaught-typeerror---extend-is-not-a-function/23528>\
**Category:** Elasticsearch\
**Created:** [May 4, 2015, 8:12am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-uncaught-typeerror---extend-is-not-a-function/23528 "2015-05-04T08:12:26Z")\
**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, 8:12am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-uncaught-typeerror---extend-is-not-a-function/23528/1 "2015-05-04T08:12:26Z")

</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' : '../bower_components/elasticsearch/elasticsearch',
    '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',
		apiVersion: '1.5',
		log: 'trace'
	});
});

```

});

* * *

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

Uncaught TypeError: \_.extend is not a function

40.\_\_browserify\_Buffer @ elasticsearch.angular.js:38901

s @ elasticsearch.angular.js:4

(anonymous function) @ elasticsearch.angular.js:4

24.../connection @ elasticsearch.angular.js:37262

s @ elasticsearch.angular.js:4

(anonymous function) @ elasticsearch.angular.js:4

15../lib/client @ elasticsearch.angular.js:18307

s @ elasticsearch.angular.js:4

e @ elasticsearch.angular.js:4

(anonymous function) @ elasticsearch.angular.js:4

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.

--  
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/384687d4-1fc2-41d1-b510-061b6b112d13%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/384687d4-1fc2-41d1-b510-061b6b112d13%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:16am UTC](https://discuss.elastic.co/t/requirejs-with-elasticsearch-angular-app-throwing-uncaught-typeerror---extend-is-not-a-function/23528/2 "2017-07-06T00:16:01Z")

</div>


