EvanZhouDev / bard-ai

A lightweight library to access Google Bard.
https://www.npmjs.com/package/bard-ai
GNU General Public License v3.0
117 stars 31 forks source link

Error: TypeError: Cannot read properties of nul l (reading '4') #53

Closed siam38 closed 1 year ago

siam38 commented 1 year ago

Prerequisites

Bug Description

const answer = chatData[4][0];

TypeError: Cannot read properties of nul l (reading '4') at #query (file:///home/runner/node- api/node_modules/bard-ai/index.js:240:32)

at process.processTicksAndRejections (node: internal/process/task_queues:95:5 )

at async Bard.ask (file:///home/runn er/node-api/node_modules/bard-ai/index.j s:342:24)

at async file:///home/runner/node-api/test.js:7:13

Reproduction Steps

See err

Other information

No response

Occurance Rate

I can reproduce this bug 100% of the time.

HalcyonAlcedo commented 1 year ago

I have encountered the same problem, and after investigation, I found that the reason is that my server is not in the available area of Bard. When I switch to a US server, this problem no longer occurs

ThatXliner commented 1 year ago

Is this issue still existent with the latest version of bard-ai? If no, please close the issue

Triggered0 commented 1 year ago
TypeError: Cannot read properties of null (reading '4')
at #query (file:///C:/Users/Administrator/Desktop/ForeverV14/node_modules/bard-ai/index.js:240:32)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Chat.ask (file:///C:/Users/Administrator/Desktop/ForeverV14/node_modules/bard-ai/index.js:353:32)
at async Object.execute (C:\Users\Administrator\Desktop\ForeverV14\src\events\messageCreate.js:224:31)

bard-ai@2.0.3 node v18.13.0