Builders 1.10.1 > 1.11.x causes errors
I'm by no means a TS wizard, but I try.
In one of my apps, I create a clear button that I pass around and is made available throughout the code. It's effectively a button that when hit, will delete/'close' the message it's attached to.
I create it in my interactionCreate listener like this:
I've been doing it this way for a long time without issue.
Today, whilst having an unrelated issue with zlib-sync not installing on my MacBook, I tried to troubleshoot and in the process, I deleted node_modules and the package-lock file. The issue didn't resolve, but as a side effect, it meant the builders dependency for discord.js got bumped from 1.10.1 to 1.11.0 (and then 1.11.1 a short while ago).
This immediately flooded my app with errors, 172 specifically. Looking at it closer I see that every single one of them related to an issue with
ActionRowBuilder<ButtonBuilder>
no longer satisfying the type requirements for the components array of a message/interaction response.
Downgrading the dependency back to 1.10.1 removed all the errors immediately.
I'd rather be up to date, so I have no issue with 'fixing' my code to accommodate whatever specific type changes were made, but I struggle to see what was changed to cause the error, given how the existing components are fundamentally unchanged.
This is the error I get when using 1.11. with my above code:
Any input or advice would be greatly appreciated.23 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!you aren't meant to install builders separately, you should use the one that's re-exported by djs
I never said I was installing it seperately
are you sure you're on latest djs? from what I recall builders should be pinned
which is why I assumed you installed it separately
hmm what about discord-api-types?
thats after deleting node_modules and package-lock again for a clean install
and you're passing that row to components: [row] right?
thats right
can't see anything particularly wrong, maybe someone else can
thanks for your input though
uh I actually misread the error, it's not even a dtypes missmatch
it says type is missing?
that version released a while ago so it could be possible that that's an oversight
the team is releasing and fixing a bunch of versions so it's possible there's a bug and it'll be fixed soon
talking with the team, it should be fixed soon in next djs
caught them in the middle of a release train
I wanted to believe it could be a bug, but I was also just as sure it could be a mistake by me which is why I made the post. I'll wait to see if Qjuh or any of the maintainers make a comment in here given their hands on work with this
from a maintainer
^^
no idea what caused it in the first place but apparently it's fixed so :shrug:
sorry! I didn't spot this, thank you 🙂
oops didn't forward the "this works with current state of the branch" (not released)
I wonder if that means it will be fixed in 1.11.2 or if it's meant to have already been fixed in 1.11.1
that works?
should mean that you'll have to bump djs once it releases and it should work
I don't think there's any more changes pending to builders
unless a bug is spotted ofc, but this one seems to be fixed
eh, installing versions of packages that aren't already published to npm is outside of what I've messed with in the past. I'll trust that it's being fixed and stick with 14.18.0 and 1.10.1 for now
thanks for the help though, its much appreciated
should be fixed, can you try after updating?
once a new version is released with the fix included, I'll definitely be trying it to confirm it's working 🙂
it's released though, #announcements
I looked 3 minutes ago, when I typed my message, and neither github or npmjs was showing a new version
I see it now though 🙂
and can confirm no errors, working as intended
quite a relief to know it wasn't a me issue