#Modal error

1 messages · Page 1 of 1 (latest)

chilly rampart
#

I still can't reproduce this... can you show your package.json? Wanna see if you're using something else that may be interfering with internals

jaunty carbon
#

Okay, so i tried and the crash seems to be around the :

const channelIdInput: Djs.LabelBuilder = new Djs.LabelBuilder()
        .setLabel(ul("modals.channel.name"))
        .setChannelSelectMenuComponent(
            new Djs.ChannelSelectMenuBuilder()
                .setCustomId("channelId")
                .setPlaceholder(ul("modals.channel.description"))
                .setRequired(false)
                .setMaxValues(1)
        );
#

I use:

const customChannel = allowCustomChannel
        ? (interaction.fields.getSelectedChannels("channelId")?.map((c) => c.id)[0] ?? "")
        : "";
chilly rampart
#

Also, it might be a big help if you can show your resolved data from internals.

If you go to discord.js/src/structures/ModalSubmitInteraction.js#L161 from your node modules (your stack trace goes there) and then add console.log(resolved) and run it again, that could be very helpful

jaunty carbon
#

Yes, sur!

{
    "name": "dicelette",
    "version": "2.3.4",
    "engineStrict": true,
    "private": true,
    "scripts": {
        "lint": "biome format --write packages",
        "build": "pnpm run --recursive build",
        "predev": "pnpm run --recursive prebuild",
        "dev": "tsx watch --tsconfig=tsconfig.dev.json --clear-screen=false packages/bot/index.ts ",
        "dev:prod": "cross-env PROD=true tsx watch --tsconfig=tsconfig.dev.json --clear-screen=false packages/bot/index.ts ",
        "prerelease": "pnpm run --recursive tsc",
        "release": "commit-and-tag-version",
        "pm2:start": "pnpm run build && pm2 start packages/bot/dist/index.js --name dicelette --log-date-format=\"YYYY-MM-DD HH:mm Z\"",
        "pm2:restart": "pnpm run build && pm2 restart dicelette",
        "pm2:stop": "pm2 stop dicelette",
        "pm2:delete": "pm2 delete dicelette",
        "test": "pnpm --filter @dicelette/parse_result run test",
        "prepare": "husky"
    },
    "engines": {
        "node": "^20.0.0"
    },
    "commit-and-tag-version": {
        "t": "",
        "bumpFiles": [
            {
                "filename": "packages/bot/package.json",
                "type": "json"
            },
            {
                "filename": "package.json",
                "type": "json"
            }
        ]
    },
    "keywords": [],
    "author": "",
    "license": "GNU GPLv3",
    "devDependencies": {
        "@biomejs/biome": "^2.2.0",
        "commit-and-tag-version": "^12.5.2",
        "cross-env": "^7.0.3",
        "husky": "^9.1.7",
        "i18next": "^25.3.5",
        "rimraf": "^6.0.1",
        "ts-loader": "^9.5.2",
        "tsc-alias": "^1.8.16",
        "tsconfig-paths": "^4.2.0",
        "typescript": "^5.9.2",
        "vite-tsconfig-paths": "^5.1.4",
        "vitest": "^3.2.4"
    },
    "dependencies": {
        "@dicelette/core": "^1.18.5",
        "@types/node": "^22.17.1",
        "dedent": "^1.6.0",
        "discord.js": "14.23.1",
        "dotenv": "^17.2.1",
        "tslog": "^4.9.3",
        "tsx": "^4.20.4",
        "uniformize": "^2.4.0"
    },
    "pnpm": {
        "onlyBuiltDependencies": [
            "@biomejs/biome",
            "better-sqlite3",
            "canvas",
            "esbuild"
        ]
    }
}

It's a monorepo so I have multiple packages.json
For the bot:

{
    "name": "@dicelette/bot",
    "version": "2.3.4",
    "description": "",
    "main": "dist/index.js",
    "type": "module",
    "scripts": {
        "prebuild": "rimraf dist",
        "tsc": "tsc --project tsconfig.json --skipLibCheck --noEmit && tsc-alias -p tsconfig.json",
        "build": "tsc --outdir dist --project tsconfig.json && tsc-alias -p tsconfig.json"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/Dicelette/discord-dicelette.git"
    },
    "private": true,
    "dependencies": {
        "@dicelette/localization": "workspace:*",
        "@dicelette/parse_result": "workspace:*",
        "@dicelette/types": "workspace:*",
        "@dicelette/utils": "workspace:*",
        "@discordjs/rest": "^2.4.2",
        "@types/parse-color": "^1.0.3",
        "canvas": "^3.0.1",
        "chart.js": "3.5.1",
        "chartjs-node-canvas": "^4.1.6",
        "discord-api-types": "^0.37.115",
        "enmap": "^6.0.3",
        "mathjs": "^14.0.1",
        "parse-color": "^1.0.0"
    },
    "devDependencies": {
        "@types/papaparse": "^5.3.15",
        "dedent": "^1.5.3",
        "moment": "^2.30.1",
        "nodemon": "^3.1.9",
        "papaparse": "^5.4.1",
        "tsconfig-paths": "^4.2.0"
    },
    "peerDependencies": {
        "chart.js": "3.5.1"
    }
}
chilly rampart
#

Omg I figured it out

jaunty carbon
#
Interaction received: 3
L161 {
  users: {
    '189390243676422144': {
      username: 'mara__li',
      public_flags: 4194560,
      primary_guild: [Object],
      id: '189390243676422144',
      global_name: 'Mara',
      display_name_styles: null,
      discriminator: '0',
      collectibles: [Object],
      clan: [Object],
      avatar_decoration_data: null,
      avatar: 'edb15c926be178e196c79830a95bc6c1'
    }
  },
  members: {
    '189390243676422144': {
      unusual_dm_activity_until: null,
      roles: [Array],
      premium_since: null,
      permissions: '9007199254740991',
      pending: false,
      nick: 'Mara-Li',
      joined_at: '2018-06-04T11:44:34.398000+00:00',
      flags: 0,
      display_name_styles: null,
      communication_disabled_until: null,
      collectibles: null,
      banner: null,
      avatar: '3b2ba50d8c2658d92e69b97f1da0f6e4'
    }
  }
}
187 {
  users: {
    '189390243676422144': {
      username: 'mara__li',
      public_flags: 4194560,
      primary_guild: [Object],
      id: '189390243676422144',
      global_name: 'Mara',
      display_name_styles: null,
      discriminator: '0',
      collectibles: [Object],
      clan: [Object],
      avatar_decoration_data: null,
      avatar: 'edb15c926be178e196c79830a95bc6c1'
    }
  },
  members: {
    '189390243676422144': {
      unusual_dm_activity_until: null,
      roles: [Array],
      premium_since: null,
      permissions: '9007199254740991',
      pending: false,
      nick: 'Mara-Li',
      joined_at: '2018-06-04T11:44:34.398000+00:00',
      flags: 0,
      display_name_styles: null,
      communication_disabled_until: null,
      collectibles: null,
      banner: null,
      avatar: '3b2ba50d8c2658d92e69b97f1da0f6e4'
    }
  }
}
L161 {
  users: {
    '189390243676422144': {
      username: 'mara__li',
      public_flags: 4194560,
      primary_guild: [Object],
      id: '189390243676422144',
      global_name: 'Mara',
      display_name_styles: null,
      discriminator: '0',
      collectibles: [Object],
      clan: [Object],
      avatar_decoration_data: null,
      avatar: 'edb15c926be178e196c79830a95bc6c1'
    }
  },
  members: {
    '189390243676422144': {
      unusual_dm_activity_until: null,
      roles: [Array],
      premium_since: null,
      permissions: '9007199254740991',
      pending: false,
      nick: 'Mara-Li',
      joined_at: '2018-06-04T11:44:34.398000+00:00',
      flags: 0,
      display_name_styles: null,
      communication_disabled_until: null,
      collectibles: null,
      banner: null,
      avatar: '3b2ba50d8c2658d92e69b97f1da0f6e4'
    }
  }
}
chilly rampart
#

Nah

#

Can't reproduce with your code in that issue