# TypeError: weaviate.connectToWCS is not a function

**URL:** <https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474>\
**Category:** Support\
**Created:** [May 25, 2024, 7:17am UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474 "2024-05-25T07:17:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrkoh](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jrkoh/32/1581_2.png) [@jrkoh](https://forum.weaviate.io/u/jrkoh)\
**Post date:** [May 25, 2024, 7:17am UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474/1 "2024-05-25T07:17:31Z")

</div>

### Description

I am attempting to use `weaviate-client` in my nodejs application and followed Weaviate’s [documentation](https://weaviate.io/developers/weaviate/client-libraries/typescript/typescript-v3)

Unfortunately, their sample code doesn’t seem to work for me at all.

```auto
import weaviate from 'weaviate-client'

const search = async () => {
    const client = await weaviate.connectToWCS(
        MY_WEAVIATE_URL, { 
          authCredentials: new weaviate.ApiKey(MY_API_KEY), 
          headers: {
            'X-OpenAI-Api-Key': MY_OPENAI_API_KEY,
          }
        } 
      )

    console.log(client)
}

search()

```

The error that I’ve been receiving is `TypeError: weaviate.connectToWCS is not a function`. Am I missing something?

### Server Setup Information

I’m using “weaviate-client”: “^3.0.0-rc.4”

- Client Language and Version: nodejs v21

### Any additional Information

I have “type”: “module” in my package.json

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [May 25, 2024, 9:06am UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474/2 "2024-05-25T09:06:18Z")

</div>

Hi! Welcome to our community!

How have you installed the client?

Note that the way to install it, as described in the doc is:

`npm install weaviate-client --tag next`

This is the output when I run

```auto
npm list | grep weaviate

```

```auto
❯ npm list | grep weaviate
lab@ /Users/dudanogueira/dev/weaviate/lab
+-- weaviate-client@3.0.0-rc.4
`-- weaviate-ts-client@2.1.1

```

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![jrkoh](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jrkoh/32/1581_2.png) [@jrkoh](https://forum.weaviate.io/u/jrkoh)\
**Post date:** [May 25, 2024, 10:41am UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474/3 "2024-05-25T10:41:52Z")

</div>

I have installed as per the documentation’s instruction.

This is what I see when i run the grep

```auto
npm list | grep weaviate
└── weaviate-client@3.0.0-rc.4

```

---

<div class="post-metadata">

**Author:** ![sebawita](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sebawita/32/5_2.png) [@sebawita](https://forum.weaviate.io/u/sebawita)\
**Post date:** [May 27, 2024, 4:53pm UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474/4 "2024-05-27T16:53:54Z")

</div>

Hi @jrkoh,

> [@jrkoh](#):
>
> The error that I’ve been receiving is `TypeError: weaviate.connectToWCS is not a function`. Am I missing something?

We are just going through the final update to the Weaviate client, where we introduced a breaking change.

`connectToWCS()` is now `connectToWCD`  
like this:

```typescript
import weaviate from 'weaviate-client'

const search = async () => {
    const client = await weaviate.connectToWCD(
        MY_WEAVIATE_URL, { 
          authCredentials: new weaviate.ApiKey(MY_API_KEY), 
          headers: {
            'X-OpenAI-Api-Key': MY_OPENAI_API_KEY,
          }
        } 
      )

    console.log(client)
}

search()

```

## GA coming soon

The GA of the new client will land later this week, so there shouldn’t be any more surprises (breaking changes 🙏).

I hope that you didn’t get too discouraged.

## Docs update

We are working on the final docs updates, which should fix all the missing changes.

Let me know if I can help.

---

<div class="post-metadata">

**Author:** ![jrkoh](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jrkoh/32/1581_2.png) [@jrkoh](https://forum.weaviate.io/u/jrkoh)\
**Post date:** [May 28, 2024, 1:18pm UTC](https://forum.weaviate.io/t/typeerror-weaviate-connecttowcs-is-not-a-function/2474/5 "2024-05-28T13:18:04Z")

</div>

Thanks @sebawita.

I’ll wait for the GA updates to land by the end of this week and give it another go sometime next week. Hopefully all goes well.
