# Error when use ipfs-api in react

**URL:** <https://discuss.ipfs.tech/t/error-when-use-ipfs-api-in-react/1566>\
**Category:** Help\
**Tags:** js-ipfs\
**Created:** [December 5, 2017, 5:54am UTC](https://discuss.ipfs.tech/t/error-when-use-ipfs-api-in-react/1566 "2017-12-05T05:54:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cch1996](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@Cch1996](https://discuss.ipfs.tech/u/Cch1996)\
**Post date:** [December 5, 2017, 5:54am UTC](https://discuss.ipfs.tech/t/error-when-use-ipfs-api-in-react/1566/1 "2017-12-05T05:54:49Z")

</div>

I want to use ipfs-api in my react project.  
I successfully installed ipfs-api in my project using npm, and import ipfs and importt the module

```
const ipfsAPI = require('ipfs-api')
const ipfs = ipfsAPI('localhost', '5001', {protocol: 'http'})

```

however, when i run my project, there is an error:

```
 Uncaught TypeError: Object prototype may only be an Object or null: undefined
at Function.create (<anonymous>)
at Object.inherits (bundle.js:61303)
at Object.<anonymous> (bundle.js:71180)
at Object.<anonymous> (bundle.js:71186)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at Object.<anonymous> (bundle.js:71137)
at Object.<anonymous> (bundle.js:71152)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)

```

I don’t know what is wrong.

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [December 5, 2017, 2:23pm UTC](https://discuss.ipfs.tech/t/error-when-use-ipfs-api-in-react/1566/2 "2017-12-05T14:23:45Z")

</div>

i think maybe link to webpack instead of react
