Skip to content

Type Checking Bug #2605

@dave9123

Description

@dave9123

@slack/bolt version

4.4.0

Your App and Receiver Configuration

const app = new App({
    token: process.env.SLACK_OAUTH_TOKEN,
    signingSecret: process.env.SLACK_SIGNING_SECRET,
    socketMode: process.env.SLACK_SOCKET_MODE == "true",
    appToken: process.env.SLACK_SOCKET_MODE == "true" ? process.env.SLACK_APP_TOKEN : undefined,
    port: parseInt(process.env.SLACK_PORT || "3000", 10),
    customRoutes: [
        {
            path: "/ping",
            method: "GET",
            handler: (req, res) => {
                res.statusCode = 200;
                res.setHeader("Content-Type", "text/plain");
                res.end("Pong!");
            }
        }
    ]
});

Node.js runtime version

v22.17.0

Steps to reproduce:

tsconfig.json

{
    "compilerOptions": {
        "esModuleInterop": true,
        "skipLibCheck": true,
        "target": "es2022",
        "allowJs": true,
        "resolveJsonModule": true,
        "moduleDetection": "force",
        "isolatedModules": true,
        "strict": true,
        "noUncheckedIndexedAccess": true,
        "noImplicitOverride": true,
        "module": "NodeNext",
        "outDir": "dist",
        "sourceMap": true,
        "lib": [
            "es2022"
        ]
    },
    "include": [
        "src/**/*"
    ],
}

Steps to reproduce (this does not happens only on app.action)

  1. On app.action, check body.user.username
  2. On app.action, check body.actions[0].value
  3. On app.action, check body.trigger_id

Expected result:

It shouldn't have show type errors

Actual result:

Image
Image
Image
Image

It seems to be showing up multiple errors on the type checking although it shows up when I try to view it through console.log

Errors

Property 'trigger_id' does not exist on type 'SlackViewAction'.\n Property 'trigger_id' does not exist on type 'ViewClosedAction'
Property 'username' does not exist on type '{ id: string; name: string; team_id?: string | undefined; } | { id: string; username: string; team_id?: string | undefined; } | { id: string; name?: string | undefined; username: string; team_id?: string | undefined; } | { ...; }'.\n Property 'username' does not exist on type '{ id: string; name: string; team_id?: string | undefined; }'
Property 'trigger_id' does not exist on type 'SlackAction'.\n Property 'trigger_id' does not exist on type 'DialogSubmitAction'
Property 'actions' does not exist on type 'SlackAction'.\n Property 'actions' does not exist on type 'DialogSubmitAction'
Property 'view' does not exist on type 'SlackAction'.\n Property 'view' does not exist on type 'InteractiveMessage'

Metadata

Metadata

Labels

TypeScript-specificauto-triage-skipPrevent this issue from being closed due to lack of activityquestionM-T: User needs support to use the project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions