# Gulp fails on type definitions added via typings while VS2015 has no problem

**URL:** <https://forum.ionicframework.com/t/gulp-fails-on-type-definitions-added-via-typings-while-vs2015-has-no-problem/52497>\
**Category:** ionic-v3\
**Created:** [May 19, 2016, 8:09pm UTC](https://forum.ionicframework.com/t/gulp-fails-on-type-definitions-added-via-typings-while-vs2015-has-no-problem/52497 "2016-05-19T20:09:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![AntonioMendez](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/antoniomendez/32/100730_2.png) [@AntonioMendez](https://forum.ionicframework.com/u/AntonioMendez)\
**Post date:** [May 20, 2016, 1:42pm UTC](https://forum.ionicframework.com/t/gulp-fails-on-type-definitions-added-via-typings-while-vs2015-has-no-problem/52497/4 "2016-05-20T13:42:32Z")

</div>

Reading some docs about **gulp.js** and how _tasks_ work, I found myself asolution and it is quite simple. In [_gulpfile.js_](https://github.com/AYOZEMONZON/SnappyMap/blob/add-rabbitmq-1/gulpfile.js), there is a variable that needs the _ionic-gulp-browserify-typescript_ library. This library uses Browserify to transpile and bundle the TypeScript source files.:

```
var buildBrowserify = require('ionic-gulp-browserify-typescript');

```

As you can see in the [npm API doc](https://www.npmjs.com/package/ionic-gulp-browserify-typescript) of the library, there is an option (_src_) which says:

> - **src** (string|File|Array) String, file object, or array of those types (they may be mixed) specifying Browserify entry file(s). **Default: [‘./app/app.ts’, ‘./typings/main.d.ts’].**

When you install the typescript definitions for the library via `typings install amqplib --save`, it sometimes creates its own _ **index.d.ts** _ file inside _typings_ directory, so the gulp builder and _Browserify_ will ignore it:

![image](https://global.discourse-cdn.com/ionicframework/original/3X/c/2/c2d5a800f1506ebe33d4f547408437a35dc7d3da.png)

### **Posible solutions:**

- The **first** one: **Add _index.d.ts_ to the library _src_ field (not recommended)**:

Everything you have to do is adding the _index.d.ts_ file to the _src_ field at _node\_modules \> ionic-gulp-browserify-typescript \> index.js_, like this:

```
src: ['./app/app.ts', './typings/main.d.ts', './typings/index.d.ts'],

```

I would say it is **not recommended** because you are changing code in the library itself, and it is never a good idea if you don’t know exactly how it works.

- The **second** one: **Add the references to main.d.ts** :

You only need to copy the content from _index.d.ts_…

```
/// <reference path="globals/amqplib/index.d.ts" />
/// <reference path="globals/node/index.d.ts" />
/// <reference path="globals/when/index.d.ts" />

```

… and add it to _main.d.ts_. Once it is done, the gulp builder will understand where amqplib typescript defiinition is located and you will get no error messages from _build_ task.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/e/4/e44806111f781fd63ab3d45c20fe1b078d1cff7c.png)

---

_[View the full topic](https://forum.ionicframework.com/t/gulp-fails-on-type-definitions-added-via-typings-while-vs2015-has-no-problem/52497)._
