Cannot read properties of null (reading 'byteLength') with AttachmentBuilder & @napi-rs/canvas
Moving my question from the djs help channel to here.
currently running into an issue when attempting to edit an interaction reply with a buffer image created using napi-rs/canvas
This is the code which creates and sends the image. Commenting out the files property prevents the error, though of course prevents the image from being sent.
I've logged
captcha
and it's definitely a buffer, and I've also stored it as a file, and it's definitely a working image
d.js version: v14.19.3
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!I've also logged this:
could you also share the output from
npm ls undici
?yeah for some reason
@discordjs/rest
seems to be using that installation of undici v7
the lines in your stack trace match up with v7 as opposed to v6, and I can only reproduce this by overriding the pinned version in /restnot sure why my other bot (which currently runs v14.19.1 but so did this one until i updated earlier) doesnt run into this same issue. this is the other bot's output for npm ls undici:
only solution i've been able to think of is just downgrading my elastic search version to one which uses v6. Have you got any ideas? @duck
frankly, I usually assume issues like this are caused at a package manager level
if you haven't tried it already, a fresh install of deps may help
i had tried that multiple times. i've managed to fix it now though, something to do with importing a file which exported an elastic search document. not sure how it occured considering this file is exported on both cluster and manager side but it's fixed now so thats good enough for me 😅