# Call to ipf through react app hanging forever

**URL:** <https://discuss.ipfs.tech/t/call-to-ipf-through-react-app-hanging-forever/12297>\
**Category:** Uncategorized\
**Created:** [September 29, 2021, 8:53am UTC](https://discuss.ipfs.tech/t/call-to-ipf-through-react-app-hanging-forever/12297 "2021-09-29T08:53:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkomaturi2382](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rkomaturi2382](https://discuss.ipfs.tech/u/rkomaturi2382)\
**Post date:** [September 29, 2021, 8:53am UTC](https://discuss.ipfs.tech/t/call-to-ipf-through-react-app-hanging-forever/12297/1 "2021-09-29T08:53:10Z")

</div>

i am trying to add small json to ipfs using ipfs-http-client package , i can see ipfs running as daemon in local machine without any issues and alsoi am able to add string to ipfs through linux console but same i am trying from react app but its not working

const ipfsClient = require(‘ipfs-http-client’)

```
i have tried below two ways to create ipfs object both are returning object so no issues

const ipfs = ipfsClient.create ({
   host: 'localhost',
    port: 5001,
    rotocol: 'http'
})

const ipfs = ipfsClient.create('/ip4/0.0.0.0/tcp/5001');

```

Problem is i am not able to add file to ipfs with below call , its hanging forever

```
obj[address] = {
            
            fullname,
            status: "Active"
        }

        let buffer = Buffer.from(JSON.stringify(obj));
        console.log(buffer);
        console.log(ipfs);
        return new Promise((resolve, reject) => {
            ipfs.add(buffer, async (error, response) => {
                if (error) {
                    console.error(error);
                } else {
                    const hash = await response[0].hash;
                    resolve(hash);
                }
            })
        })
```
