#Argument of type 'ButtonStyle.Link' is not assignable to parameter of type 'ButtonStyle'

34 messages · Page 1 of 1 (latest)

quiet merlin
#
Argument of type 'ButtonStyle.Link' is not assignable to parameter of type 'ButtonStyle'.ts(2345)

Im using @discord.js/core with @discordjs/builders for the ButtonBuilder and discord-api-types/v10 for the ButtonStyle

Versions:
discord-api-types: "^0.37.92"
@discordjs/core: "^1.2.0",
@discordjs/builders: "^1.8.2",

icy pythonBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
quiet merlin
#

Node: 18.16.1

raw eagle
#

Using different packages for the bot always causes issues for me

quiet merlin
raw eagle
#

ohh I'm afraid I can't help you then

meager raven
#

ts enums are confusing

#

btw you should use node 20 which is latest lts, it's probably not related to your issue but a general recommendation

quiet merlin
quiet merlin
#

...

prime pollen
#

even if you're not using discord.js, I'd still recommend not installing discord-api-types separately and just using whatever comes with /core (which does also reexport some things such as enums)

#

I can only reproduce this with a mismatched discord-api-types version

quiet merlin
#

when i do this and it's imported from the core package it throws an error but when imported from discord-api-types it doesnt

tribal finch
#

npm ls discord-api-types

#

And does that error show in IDE or also on tsc compile?

quiet merlin
quiet merlin
formal lark
tribal finch
# quiet merlin

So you literally have a differing version of dtypes installed separately causing a version mismatch. Which duck told you before. Remove that explicit discord-api-types dependency

void vaultBOT
#

dtypes v10: isMessageComponentButtonInteraction
read more

quiet merlin
#

for this

split harbor
#

its already installed by other deps, just import it from there

ivory forge
#

Phatom deoendencies 💀

latent linden