1

I have been trying to get the Pinecone Demo chat app in their own website up and running.Link to it. I have put all the keys properly in the .env file and the UI seems to pop up correctly. However, it shows the error:

[TypeError: Cannot read properties of null (reading 'replace')]
13:58:48.950 Ably: Auth.requestToken(): token request signing call returned error; err = [RequestError: connect ECONNREFUSED ::1:3000] {
  code: 'ECONNREFUSED',
  timings: {
    start: 1684312128941,
    socket: 1684312128945,
    lookup: 1684312128947,
    connect: undefined,
    secureConnect: undefined,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1684312128948,
    abort: undefined,
    phases: {
      wait: 4,
      dns: 2,
      tcp: undefined,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 7
    }
  }
}

I have used the pregenerated API keys in Ably and created new ones also in the app created. It doesn't seem to work with any of them.

Here's how its setup: Setup of Ably API keys inside the app

If you think the issue is with another API/service that's leading to this break, please do tell me that as well. Thanks in advance!

AaravS
  • 23
  • 3

1 Answers1

0

In the error you're getting you'll see RequestError: connect ECONNREFUSED ::1:3000. I assume you've got the API_ROOT in your .env correctly set to 'localhost:3000'. This error is meaning Ably is attempting to get a token from this endpoint, but the attempt to connect has failed.

For some reason it appears to not be correctly converting from localhost to 127.0.0.1 (I've seen mentions of it being related to node version).

If you are hosting the server at 127.0.0.1:3000, you can update your API_ROOT to be API_ROOT="http://127.0.0.1:3000". This should ensure that it's being interpreted correctly.

Tom Camp
  • 66
  • 3