realcoloride / node_characterai

Unofficial Character AI wrapper for node.
https://beta.character.ai/
341 stars 72 forks source link

Cannot read properties of undefined (reading 'status') #171

Closed Zaxerion closed 3 months ago

Zaxerion commented 4 months ago

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)

realcoloride commented 4 months ago

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

jacpa2011 commented 3 months ago

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)
realcoloride commented 3 months ago

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

jacpa2011 commented 3 months ago

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

realcoloride commented 3 months ago

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

jacpa2011 commented 3 months ago

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.

jacpa2011 commented 3 months ago

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