realcoloride/node_characterai

Cannot read properties of undefined (reading 'status')

Zaxerion opened this issue · 7 comments

when I send a new message before the bot responds to the old message, I get this error

[node_characterai] Puppeteer - TypeError: Failed to fetch
/home/container/node_modules/node_characterai/chat.js:62
if (request.status() === 200) {
^

TypeError: Cannot read properties of undefined (reading 'status')
at Chat.sendAndAwaitResponse (/home/container/node_modules/node_characterai/chat.js:62:21)

Hello, I do not understand your problem, could you re-explain?

I had this problem too, It randomly gives this error

(censored) is for privacy purposes
Perhaps it is a rate limit issue?

[node_characterai] Puppeteer - Error: Evaluation failed: TypeError: Failed to fetch
    at pptr://__puppeteer_evaluation_script__:2:44
Error generating completion: TypeError: Cannot read properties of undefined (reading 'status')
    at Chat.sendAndAwaitResponse (censored)
    at the process.processTicksAndRejections (node: internal/process/task_queues:95:5)
    at async dotheaithingy (censored)

Could you tell me the version of node_characterai you use, OS and chromium version?

Well since OP is probably not going to respond:
I have the latest version of node_characterai, windows 10 Home, and Chrome 125.

Chromium version, not chrome. Try removing the node_modules folder and run npm i command, then try your script.

How can I check? I'm not so familiar with chromium...

Anyway I ran npm i and it still gives this error, also it seems like it provides an error specifically when you send 2 requests at the same time, similar to the interception issue, however, this one occurs whenever the 2 requests are more apart...
The solution could be just the same thing as the one for the interception issue.

Update:
yep, problem solved, not getting the error anymore.