Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'text') #23

Open
Scott-Zeta opened this issue Oct 9, 2023 · 2 comments
Open

Comments

@Scott-Zeta
Copy link

Scott-Zeta commented Oct 9, 2023

I keep encountering with the error

TypeError: Cannot read properties of undefined (reading 'text')
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:136:40)
    at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:107:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:48:20)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:26:71)
    at new Promise (<anonymous>)
    at __awaiter (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:8:12)
    at extractMessage (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/utils.js:129:12)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:178:76)
    at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:107:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:48:20)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:26:71)
    at new Promise (<anonymous>)
    at __awaiter (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:8:12)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:171:36)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:151:25)
    at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:107:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:48:20)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:26:71)
    at new Promise (<anonymous>)
    at __awaiter (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:8:12)
    at handleFetchError (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:136:12)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:170:54)
    at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:107:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:48:20)
    at eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:26:71)
    at new Promise (<anonymous>)
    at __awaiter (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:8:12)
    at handleApiError (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/errors/handling.js:164:12)
    at UpsertCommand.eval (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/data/upsert.js:178:57)
    at step (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/data/upsert.js:107:23)
    at Object.eval [as throw] (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/data/upsert.js:48:20)
    at rejected (webpack-internal:///(rsc)/./node_modules/@pinecone-database/pinecone/dist/data/upsert.js:18:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

When trying to upsert vectors to Pinecone.
I think the 'text' does not refer to the text varibale I am trying to upsert. And not only the upsert, any operation would return this error.

I search on internet and there is a similar situation, don't know if they are relative.
https://github.com/pinecone-io/pinecone-ts-client/issues/124
Here is my code and welcome to judge.
https://github.com/Scott-Zeta/chatpdf/blob/main/src/lib/pinecone.ts
Thanks!

@mario-oliver
Copy link

It's an issue with the pinecone sdk interaction with next.js, sadly. You will encounter the same issue when using pinecone.query(). Here's the current thread on the pinecone sdk to attempt to fix this issue. pinecone-io/pinecone-ts-client#124
If you are looking for an immediate solution, then considering creating a fetch or axios.post() request directly to the pinecone api for upsert() and for query(). It was the fastest solution while the pinecone team implements a fix from the polyfill cross-fetch issue with next.js. From that thread here is someone's solution implementing the aforementioned work-around - pinecone-io/pinecone-ts-client#124 (comment)

@Scott-Zeta
Copy link
Author

It's an issue with the pinecone sdk interaction with next.js, sadly. You will encounter the same issue when using pinecone.query(). Here's the current thread on the pinecone sdk to attempt to fix this issue. pinecone-io/pinecone-ts-client#124 If you are looking for an immediate solution, then considering creating a fetch or axios.post() request directly to the pinecone api for upsert() and for query(). It was the fastest solution while the pinecone team implements a fix from the polyfill cross-fetch issue with next.js. From that thread here is someone's solution implementing the aforementioned work-around - pinecone-io/pinecone-ts-client#124 (comment)

I have successfully uploaded my first vectors to Pinecone, Great thanks!
Hope it could be smooth in following steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants