Closed YoYo178 closed 2 years ago
Check with the latest development build
Npm: npm install MenuDocs/erela.js#build
Yarn: yarn add MenuDocs/erela.js#build
Note: To install the development build you would require git to be installed on your machine.
The development build hasn't been updated from what I can tell
edit: bad lockfile
the error still persists but it's a bit different this time
HeadersTimeoutError: Headers Timeout Error
at Timeout.onParserTimeout [as _onTimeout] (/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28)
at listOnTimeout (node:internal/timers:561:11)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_HEADERS_TIMEOUT'
}
EDIT - forgot to mention that i use Discord.JS v14.1.1 EDIT 2 - and as it turns out it doesn't really crash my bot but it's still annoying as it keeps spamming in the console in a regular interval EDIT 3 - uh it does crash my bot actually
Same issue with me DJs v13
0|main | SyntaxError: Unexpected token in JSON at position 0
0|main | at JSON.parse ()
0|main | at Y.json (/home/ubuntu/bot/node_modules/petitio/dist/index.js:30:574)
0|main | at ke.json (/home/ubuntu/bot/node_modules/petitio/dist/index.js:30:2499)
0|main | at runMicrotasks ()
0|main | at processTicksAndRejections (node:internal/process/task_queues:96:5)```
Same issue with me DJs v13
0|main | SyntaxError: Unexpected token in JSON at position 0 0|main | at JSON.parse () 0|main | at Y.json (/home/ubuntu/bot/node_modules/petitio/dist/index.js:30:574) 0|main | at ke.json (/home/ubuntu/bot/node_modules/petitio/dist/index.js:30:2499) 0|main | at runMicrotasks () 0|main | at processTicksAndRejections (node:internal/process/task_queues:96:5)```
yeah i also get this error sometimes, mostly when i use a Node.js version which is above 16 here's the full error :
undefined:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Y.json (/home/runner/what/node_modules/petitio/dist/index.js:30:574)
at ke.json (/home/runner/what/node_modules/petitio/dist/index.js:30:2499)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
What if you use old version of nodejs
What if you use old version of nodejs
it still shows up but it's less frequent
In my case this is showing for every song request.
Update to dev branch of erelajs
150 was merged so should be working now
Check with the latest development build Npm:
npm install MenuDocs/erela.js#build
Yarn:yarn add MenuDocs/erela.js#build
Note: To install the development build you would require git to be installed on your machine.
install development build via this method right?
tried already.
dev build gives this error
HeadersTimeoutError: Headers Timeout Error
at Timeout.onParserTimeout [as _onTimeout] (/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28)
at listOnTimeout (node:internal/timers:561:11)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_HEADERS_TIMEOUT'
}
In my case this is showing for every song request.
that mostly happened to me when i used Node.js v18
Oh I will move in shoukaku now so np for me
Oh I will move in shoukaku now so np for me
what Java version do you use?
18
18
I use Java 16, try using Java 16
umm, I fixed like am changed the node and java versions for root and now it is working. But the thing is that my migration from erela to shoukaku is almost done. And shoukaku can also support v18 of node and java v18 so yeah as soon as possible migrate your bot also in shoukaku cause on the new and latest version ram and CPU usages is low.
This is just an issue with your node, discord.js v14 uses undici and I doubt they would use a broken HTTP library. Shoukaku probably uses node-fetch or something that uses node's http builtin module, which probably has forgiving timeouts
This is just an issue with your node, discord.js v14 uses undici and I doubt they would use a broken HTTP library. Shoukaku probably uses node-fetch or something that uses node's http builtin module, which probably has forgiving timeouts
nah it's with erela.js
becuase before i updated to the development build of erela.js, i was getting errors about petitio, and after updating to the development build i started getting errors about undici
EDIT - here's the error, it even says that it's from erela.js
HeadersTimeoutError: Headers Timeout Error
at Timeout.onParserTimeout [as _onTimeout] (/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28)
at listOnTimeout (node:internal/timers:561:11)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_HEADERS_TIMEOUT'
}
This is just an issue with your node, discord.js v14 uses undici and I doubt they would use a broken HTTP library. Shoukaku probably uses node-fetch or something that uses node's http builtin module, which probably has forgiving timeouts
nah it's with erela.js
becuase before i updated to the development build of erela.js, i was getting errors about petitio, and after updating to the development build i started getting errors about undici
EDIT - here's the error, it even says that it's from erela.js
HeadersTimeoutError: Headers Timeout Error at Timeout.onParserTimeout [as _onTimeout] (/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28) at listOnTimeout (node:internal/timers:561:11) at processTimers (node:internal/timers:502:7) { code: 'UND_ERR_HEADERS_TIMEOUT' }
If you look closely it actually from undici. "/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28"
becuase before i updated to the development build of erela.js, i was getting errors about petitio, and after updating to the development build i started getting errors about undici
petitio uses undici...
This is just an issue with your node, discord.js v14 uses undici and I doubt they would use a broken HTTP library. Shoukaku probably uses node-fetch or something that uses node's http builtin module, which probably has forgiving timeouts
nah it's with erela.js
becuase before i updated to the development build of erela.js, i was getting errors about petitio, and after updating to the development build i started getting errors about undici
EDIT - here's the error, it even says that it's from erela.js
HeadersTimeoutError: Headers Timeout Error at Timeout.onParserTimeout [as _onTimeout] (/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28) at listOnTimeout (node:internal/timers:561:11) at processTimers (node:internal/timers:502:7) { code: 'UND_ERR_HEADERS_TIMEOUT' }
If you look closely it actually from undici. "/home/runner/what/node_modules/erela.js/node_modules/undici/lib/client.js:1005:28"
yeah that's from the development build
becuase before i updated to the development build of erela.js, i was getting errors about petitio, and after updating to the development build i started getting errors about undici
petitio uses undici...
well dunno about that though
<rejected> RangeError: Plugin at index 0 does not extend Plugin.
plugins: [
new AppleMusic(),
new Spotify({
clientID,
clientSecret
})
]
my current plugins, I use better-erela.js-spotify
and better-erela.js-apple
it fixed itself when I removed
if (!(plugin instanceof Utils_1.Plugin))
throw new RangeError(`Plugin at index ${index} does not extend Plugin.`);
From the dist/structures/Manager.js
on line 78
I just pushed 524b5386f3102bc85ae740444b5c8c5d7258f3d6, try increasing the default headers timeout to a minute or something:
client.manager = new Manager({
nodes: [{
poolOptions: {
...
headersTimeout: 60e3
}
}]
...
})
Make sure to rerun the command for installing the build branch
finally that fixed the issue, thank you for your time and effort.
Hello, so I use erela.js with Lavalink for my discord bot and I receive a lot of errors from petitio and it even crashes my bot everytime.
Node.js version : v16.16.0 erela.js version : v2.3.3 Lavalink version : v3.5-rc3
this is the error I receive and it's really annoying
so is there any way to fix this?