Skip to content

PineconeClient: Project name not set. Call init() first #12

@ediardo

Description

@ediardo

Hi!

First day using Pinecone. I followed the steps at https://docs.pinecone.io/docs/node-client but I'm getting an error.

Version: 0.0.8

Code:

 const pinecone = new PineconeClient();
  await pinecone.init({
    environment: "us-east1-gcp",
    apiKey: "SECRET",
  });

  const index = pinecone.Index("websites");

  try {
    const res = await index.upsert({
      upsertRequest: {
        vectors: [
          {
            id: "1",
            values: vector,
          },
        ],
      },
    });
....

Error:

Error: PineconeClient: Project name not set. Call init() first.
    at PineconeClient.Index (./node_modules/@pinecone-database/pinecone/dist/index.js:172:19)
    at insertToVectorCollection (embeddings.js:50:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createIndex (index.js:77:9)

I tried setting the projectName right before the init() but didn't make a difference:

const pinecone = new PineconeClient();
pinecone.projectName = "websites";
await pinecone.init({...

What can I do to fix problem?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions