# API request sent by Javascript gets 'fetch failed' error

**URL:** <https://forum.weaviate.io/t/api-request-sent-by-javascript-gets-fetch-failed-error/475>\
**Category:** Support\
**Created:** [August 7, 2023, 6:03am UTC](https://forum.weaviate.io/t/api-request-sent-by-javascript-gets-fetch-failed-error/475 "2023-08-07T06:03:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phuong\_Tran\_Soul](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/phuong_tran_soul/32/343_2.png) [@Phuong\_Tran\_Soul](https://forum.weaviate.io/u/Phuong_Tran_Soul)\
**Post date:** [August 7, 2023, 6:03am UTC](https://forum.weaviate.io/t/api-request-sent-by-javascript-gets-fetch-failed-error/475/1 "2023-08-07T06:03:59Z")

</div>

Hi Weaviate,

I am new to both Weaviate and Javascript so I am just following the tutorial here: [GraphQL - Get{} | Weaviate - vector database](https://weaviate.io/developers/weaviate/api/graphql/get)

I have this code in my local machine:

```auto
const weaviate = require('weaviate-ts-client');

const client = weaviate.default.client({
  scheme: 'http',
  host: 'http://my-fourth-sandbox.weaviate.network', // my sandbox cluster url
  apiKey: '' // my api key
});

client.graphql
      .get()
      .withClassName('Paragraph')
      .withFields('fieldname') // fieldname
      .do()
      .then(res => {
        console.log(res)
      })
;

```

but when I run I keep getting this error:

```auto
Uncaught TypeError TypeError: fetch failed
    at fetch (internal/deps/undici/undici:11576:11)
    at processTicksAndRejections (internal/process/task_queues:95:5)
undici:11576
No debugger available, can not send 'variables'
Process exited with code 1

```

Could you help let me know what did I miss during the tutorial? I installed weaviate-ts-client and is running the code using Visual Studio Code.

Thank you in advance

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [August 7, 2023, 3:35pm UTC](https://forum.weaviate.io/t/api-request-sent-by-javascript-gets-fetch-failed-error/475/2 "2023-08-07T15:35:14Z")

</div>

Hi @Phuong_Tran_Soul and welcome! 😃

I’m not all that great with TS, but I think that syntax doesn’t look quite right to me. For example, the `weaviate.default.client` line should be `weaviate.client` I believe.

I recommend taking a look at the Quickstart ([Quickstart Tutorial | Weaviate - vector database](https://weaviate.io/developers/weaviate/quickstart)) as a starting point and going from there 🙂 .

Cheers!  
JP
