woodendoors7
woodendoors7
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
thanks jiralite 🤦‍♂️
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
why would it read the global dependency instead of the local one 😭
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
well it works now
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
ok
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
huh
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
There is +-- [email protected], I removed it globally (isn't in the ls anymore)
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
sorry, I was in midst of trying a different version of discord.js (removing/readding discord.js) but now it's back, and still does the same thing
{
"name": "applicationbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "woodendoors7",
"license": "ISC",
"dependencies": {
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"sqlite": "^5.0.1",
"sqlite3": "^5.1.6"
},
"type": "module"
}
{
"name": "applicationbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "woodendoors7",
"license": "ISC",
"dependencies": {
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"sqlite": "^5.0.1",
"sqlite3": "^5.1.6"
},
"type": "module"
}
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
my package.json
{
"name": "applicationbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "woodendoors7",
"license": "ISC",
"dependencies": {
"dotenv": "^16.3.1",
"sqlite": "^5.0.1",
"sqlite3": "^5.1.6"
},
"type": "module"
}
{
"name": "applicationbot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "woodendoors7",
"license": "ISC",
"dependencies": {
"dotenv": "^16.3.1",
"sqlite": "^5.0.1",
"sqlite3": "^5.1.6"
},
"type": "module"
}
this is all the related code (the entire is very big)
import { ActionRow, ModalBuilder, TextInputStyle, ActionRowBuilder, TextInputBuilder } from "discord.js"

export async function createButtonHandler(interact, customID) {
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');

const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
.setLabel("What's your favorite color?")
.setStyle(TextInputStyle.Short);


const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's some of your favorite hobbies?")
.setStyle(TextInputStyle.Paragraph);


const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);

modal.addComponents(firstActionRow);
await interact.showModal(modal);
}
import { ActionRow, ModalBuilder, TextInputStyle, ActionRowBuilder, TextInputBuilder } from "discord.js"

export async function createButtonHandler(interact, customID) {
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');

const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
.setLabel("What's your favorite color?")
.setStyle(TextInputStyle.Short);


const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's some of your favorite hobbies?")
.setStyle(TextInputStyle.Paragraph);


const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);

modal.addComponents(firstActionRow);
await interact.showModal(modal);
}
11 replies
DIAdiscord.js - Imagine an app
Created by woodendoors7 on 8/21/2023 in #djs-questions
Mysterious modal error that's got everyone puzzled: Cannot properly serialize component type:
My full stack trace is
Error: Cannot properly serialize component type: undefined
at createComponentBuilder (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1234:13)
at \applicationbot\node_modules\@discordjs\builders\dist\index.js:1284:54
at Array.map (<anonymous>)
at new ActionRowBuilder (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1284:35)
at \applicationbot\node_modules\@discordjs\builders\dist\index.js:1380:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1379:37)
at createButtonHandler (/applicationbot/src/create.js:53:11)
Error: Cannot properly serialize component type: undefined
at createComponentBuilder (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1234:13)
at \applicationbot\node_modules\@discordjs\builders\dist\index.js:1284:54
at Array.map (<anonymous>)
at new ActionRowBuilder (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1284:35)
at \applicationbot\node_modules\@discordjs\builders\dist\index.js:1380:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (\applicationbot\node_modules\@discordjs\builders\dist\index.js:1379:37)
at createButtonHandler (/applicationbot/src/create.js:53:11)
11 replies