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

31 messages · Page 1 of 1 (latest)

shut spoke
#
       const row = new ActionRowBuilder<ButtonBuilder>().addComponents(
            new ButtonBuilder().setLabel(ctx.locale("buttons.premium")).setStyle(ButtonStyle.Premium).setSKUId(""),
        );
src/commands/Info/Premium.ts:38:82 - error TS2345: Argument of type 'ButtonStyle.Premium' is not assignable to parameter of type 'ButtonStyle'.

38             new ButtonBuilder().setLabel(ctx.locale("buttons.premium")).setStyle(ButtonStyle.Premium).setSKUId(""),
                                                                                    ~~~~~~~~~~~~~~~~~~~

version: ** "discord.js": "14.16.0-dev.1722730287-f623e7a31",**

rugged spoke
#

Sounds like a version mismatch of dtypes. npm ls discord-api-types

shut spoke
rugged spoke
#

Yup, you need to override the subpackages to dev version too for that to work

shut spoke
#

I never imported them in my codes

delicate hollow
#

but d.js does

#

and you import that

rugged spoke
#

See pins of #djs-in-dev-version

#djs-in-dev-version message

shut spoke
#

I already tried it doesn’t work better

delicate hollow
#

what did you try

shut spoke
#

imported the package with the hand or ;
npm remove discord.js
npm install discord.js@dev

delicate hollow
#

that only changes d.js version

#

which is not what Qjuh said you need to do

#

nor does the message he linked say that

shut spoke
#

and I also tried to import what is mentioned in #djs-in-dev-version message

delicate hollow
#

"import"? how

#

what did you do

rugged spoke
#

That’s supposed to go in your package.json

rugged spoke
shut spoke
#

I have not made a mistake we agree?

delicate hollow
#

did you actually reinstall the dependencies after adding the override?

rugged spoke
#

Maybe you shouldn’t try to use a dev version if you can’t get that to work…

#

Because subpackagenamehere is not meant literally

shut spoke
delicate hollow
#

oh yeah

shut spoke
#

sad I wanted to start setting up the sku button

delicate hollow
#

there's setting up the premium button

#

and there's being clueless on how to change package versions and read instructions

#

🤷‍♀️