ValidationError Expected a string primitive
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string", "Expected a string primitive", value));
^
ValidationError: Expected a string primitive
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string", "Expected a string primitive", value));
^
ValidationError: Expected a string primitive
let row = new Discord.ActionRowBuilder()
.addComponents(
new Discord.SelectMenuBuilder()
.setPlaceholder("Holderplace")
.addOptions(
new Discord.SelectMenuOptionBuilder()
.setLabel("Apple")
.setValue("select1")
.setDescription("Desc1"),
new Discord.SelectMenuOptionBuilder()
.setLabel("Bread")
.setValue("select2")
.setDescription("Desc2")
)
)
interaction.update({components: [row]})
let row = new Discord.ActionRowBuilder()
.addComponents(
new Discord.SelectMenuBuilder()
.setPlaceholder("Holderplace")
.addOptions(
new Discord.SelectMenuOptionBuilder()
.setLabel("Apple")
.setValue("select1")
.setDescription("Desc1"),
new Discord.SelectMenuOptionBuilder()
.setLabel("Bread")
.setValue("select2")
.setDescription("Desc2")
)
)
interaction.update({components: [row]})
2 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.[email protected]
node v18.4.0
Full error code:
oh
thx
D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:1672
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string", "Expected a string primitive", value));
^
ValidationError: Expected a string primitive
at StringValidator.handle (D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:1672:70)
at StringValidator.parse (D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
at Object.validateRequiredSelectMenuParameters (D:\Bot\node_modules\@discordjs\builders\dist\components\Assertions.cjs:33:21)
at SelectMenuBuilder.toJSON (D:\Bot\node_modules\@discordjs\builders\dist\components\selectMenu\SelectMenu.cjs:60:16)
at D:\Bot\node_modules\@discordjs\builders\dist\components\ActionRow.cjs:26:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (D:\Bot\node_modules\@discordjs\builders\dist\components\ActionRow.cjs:26:35)
at D:\Bot\node_modules\discord.js\src\structures\MessagePayload.js:136:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (D:\Bot\node_modules\discord.js\src\structures\MessagePayload.js:136:49) {
validator: 's.string',
given: undefined
}
D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:1672
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string", "Expected a string primitive", value));
^
ValidationError: Expected a string primitive
at StringValidator.handle (D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:1672:70)
at StringValidator.parse (D:\Bot\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
at Object.validateRequiredSelectMenuParameters (D:\Bot\node_modules\@discordjs\builders\dist\components\Assertions.cjs:33:21)
at SelectMenuBuilder.toJSON (D:\Bot\node_modules\@discordjs\builders\dist\components\selectMenu\SelectMenu.cjs:60:16)
at D:\Bot\node_modules\@discordjs\builders\dist\components\ActionRow.cjs:26:64
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (D:\Bot\node_modules\@discordjs\builders\dist\components\ActionRow.cjs:26:35)
at D:\Bot\node_modules\discord.js\src\structures\MessagePayload.js:136:109
at Array.map (<anonymous>)
at MessagePayload.resolveBody (D:\Bot\node_modules\discord.js\src\structures\MessagePayload.js:136:49) {
validator: 's.string',
given: undefined
}