CORS error appears when I use query method from API

I have this error when i use API for query vectors. Anyone have a solution?

I try to call this method Pinecone API from a NextJS application.

Its weird because I can listIndexes, describeIndex, createIndex without problem.

Hi @Cedrian. This can happen when running services on localhost. We have an article in our Support Portal that addresses this along with suggested fixes.

Hi @Cory_Pinecone. I’m not using a server between pinecone and my frontend that’s why I need a way to add trusted domains so I can call this endpoint POST This is why at the moment I’m developing an app that still uses localhost. In the article you sent me it mentions that a server other than localhost should be used, but I’m using it for development. Note: I can’t use a server in the middle because it’s not my use case.

I have the same problem running a Next.js app just trying to call Pinecone on the front end (not in api folder)

Hi Cory, thank you or the article, but I don’t see the solution there. Also, I’m having this problem when running on my webserver - not in localhost. Please advise, thanks!