ExpectedValidatorError on showModal()
When attempting to respond to an interaction via interaction.showModal(), the following error appears:
15 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!Modal in question:
The caller:
ive cross checked with the docs a dozen times, my modal looks fine in terms of structure and Im nearly 100% certain a similar modal worked on this same bot
I'm sorry?
The static initialization is to be able to reference it from other classes, its like this here (individually constructed) to make sure its not the modal loader that's broken
It also only contains one component for the same reason (testing only)
this is usually how I reference it
Its also shortened because the whole file itself with the other attached methods is too large for Discord
Yes, correct
For testing
To ensure it wasnt the loader that was broken
this is what it usually looks like
Yes
This is the JS file
Modal looks okay too
The rest works, replacing the .showModal() with a .reply() successfully responds
Of?
The modal or the command reply manager?
Sorry, I went to sleep. I've experimented more and now I get a different fun error when I split the modal creation into multiple parts
This is the modal's file
Oh my god youve got to be kidding me
Okay I think the definitions for Typescript are bugged
Ive managed to get it working, all it required was that the ModalBuilder's
.addComponents()
takes actionRow.toJSON()
, and not the ActionRow itself, although the type checker does think it is correctShould I report this as a bug?
i.e.:
This works:
This does not:
This does not have the same issue, the component can be an object:
Should I setup a new JS project to test it?
Youre right, I cant reproduce it at all, even in the same project but clean (ran npm init and all that jazz)
Very odd
Thanks, I guess