slackapi / slackapi/bolt-js

Type Checking Bug

Open
#2,605 5 comments 1 reaction 1 assignee View on GitHub

@hello-ashleyintech is already working on this.

Since Jul 16, 2025.

auto-triage-skip question TypeScript-specific
Dominant language
TypeScript
Stars
2.9k
Forks
445
Avg merge
1d 3h
Merged PRs (30d)
28

Description

@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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.