skip to Main Content

The is present in the pinecone.ts

import { PineconeClient } from '@pinecone-database/pinecone'

export const getPineconeClient = async () => {
  const client = new PineconeClient()

  await client.init({
    apiKey: process.env.PINECONE_API_KEY!,
    environment: 'gcp-starter',
  })

  return client
}

core.ts (where I want to use Pinecone Client)

const pinecone = await PineconeClient() // this also giving error 
const pineconeIndex = pinecone.Index('name')

2

Answers


  1. I’m getting almost the same error:

    Module ‘"@pinecone-database/pinecone"’ has no exported member ‘PineconeClient’.ts(2305)

    Login or Signup to reply.
  2. Please check your @pinecone-database/pinecone library version, because from v1.1.0 they removed PineconeClient.

    following is the updated way of creating pincone client,

    import { Pinecone } from '@pinecone-database/pinecone';
    
    const pc = new Pinecone({
      apiKey: 'your_api_key',
    });
    

    You can refer following link for the same:

    https://docs.pinecone.io/legacy/getting-started/quickstart

    Please try this solution, if you still find an error let me know.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search