Error: Cannot probe a readable stream in object mode

I'm getting this error when trying to create the audio resource for a track, my current code is:
// YouTubeMusicPlatform.openStream
openStream(track: Track): Promise<Readable> {
return new Promise((resolve, reject) => {
try {
resolve(ytdl(track.id, { filter: 'audioonly' }))
} catch (e) {
reject(e)
}
})
}

// Track.getAudioResource
this.platform.openStream(this)
.then(stream => demuxProbe(stream))
.then((probe: { stream: any; type: any; }) => resolve(createAudioResource(probe.stream, { metadata: this, inputType: probe.type })))
.catch(err => reject(err));
// YouTubeMusicPlatform.openStream
openStream(track: Track): Promise<Readable> {
return new Promise((resolve, reject) => {
try {
resolve(ytdl(track.id, { filter: 'audioonly' }))
} catch (e) {
reject(e)
}
})
}

// Track.getAudioResource
this.platform.openStream(this)
.then(stream => demuxProbe(stream))
.then((probe: { stream: any; type: any; }) => resolve(createAudioResource(probe.stream, { metadata: this, inputType: probe.type })))
.catch(err => reject(err));
With packages
- discord.js 14.11.0
- discord.js/voice [idk npm info aint working]
- ytdl-core-discord 1.3.1
- discord.js 14.11.0
- discord.js/voice [idk npm info aint working]
- ytdl-core-discord 1.3.1
Anyone know how I might fix this issue? I was using ytdl-core before but it returned an audio resource with length 0.
No description
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
orbyfied
orbyfiedOP2y ago
node v17.1.0 i wrote some code in the logger to trim the stacktrace until Module._compile and replaces it with the x internal lines and replace .js with .ts so thats why it might look weird
Want results from more Discord servers?
Add your server