Skip to content

WorkflowButton block element missing required action_id property #2207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 7 tasks
fkywong opened this issue Mar 25, 2025 · 4 comments
Open
1 of 7 tasks

WorkflowButton block element missing required action_id property #2207

fkywong opened this issue Mar 25, 2025 · 4 comments
Labels
area:typescript issues that specifically impact using the package from typescript projects auto-triage-skip bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:types applies to `@slack/types`

Comments

@fkywong
Copy link

fkywong commented Mar 25, 2025

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

Reproducible in:

The Slack SDK version

2.14.0

Node.js runtime version

N/A; I'm running Deno:

$ deno --version        
# deno 2.2.2 (stable, release, aarch64-apple-darwin)
# v8 13.4.114.9-rusty
# typescript 5.7.3

OS info

$ sw_vers && uname -v
# ProductName:            macOS
# ProductVersion:         14.7.4
# BuildVersion:           23H420
# Darwin Kernel Version 23.6.0: Thu Dec 19 20:47:53 PST 2024; root:xnu-10063.141.1.703.2~1/RELEASE_ARM64_T6030

Steps to reproduce:

Example source code:

import { PlainTextElement, WorkflowButton } from "@slack/types";

export function getAWorkflowButton(triggerUrl: string): WorkflowButton {
  return {
    type: "workflow_button",
    text: {
      type: "plain_text",
      text: "I am a workflow button",
    } as PlainTextElement,
    action_id: "action_12345",
    workflow: {
      trigger: { url: triggerUrl },
    },
  };
}

Expected result:

deno check passes.

Actual result:

deno check fails with an unknown property error for action_id even though the documented API for a workflow button specifies action_id as a required field:

Check file:///Volumes/<REDACTED>/foo.ts
TS2353 [ERROR]: Object literal may only specify known properties, and 'action_id' does not exist in type 'WorkflowButton'.
    action_id: "action_12345",
    ~~~~~~~~~
    at file:///Volumes/<REDACTED>/foo.ts:10:5

error: Type checking failed.

Suspected issue

I believe the exported WorkflowButton type from block-elements.ts is missing extending the Actionable interface.

export interface WorkflowButton extends Confirmable {

export interface Action {
type: string;
/**
* @description: An identifier for this action. You can use this when you receive an interaction payload to
* {@link https://api.slack.com/interactivity/handling#payloads identify the source of the action}. Should be unique
* among all other `action_id`s in the containing block. Maximum length for this field is 255 characters.
*/
action_id?: string;
}
export interface Actionable extends Action {}

Spot-checking a handful of other interactive components (eg. Button, Checkboxes, NumberInput, etc.) show that they all extend the Actionable interface:

export interface Button extends Actionable, Confirmable {

export interface Datepicker extends Actionable, Confirmable, Focusable, Placeholdable {

export interface NumberInput extends Actionable, Dispatchable, Focusable, Placeholdable {

@WilliamBergamin WilliamBergamin added needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info and removed untriaged labels Mar 26, 2025
@WilliamBergamin
Copy link
Contributor

Hi @fkywong thanks for writing in 💯

This does seem like a potential bug 🤔 the the node-salck-sdk was not intended to be used with the deno runtime

Would you be able to give me more information on your app configuration in order for me to reproduce this?

@fkywong
Copy link
Author

fkywong commented Mar 26, 2025

Hey @WilliamBergamin,

Unfortunately I can't provide a direct link to our app since it's private, which is why I also had to sanitize the example source code and the resultant error message in my bug report, but to give you a bit more context.

This app is actually a workflow-based Slack app (docs.slack.dev), which requires the use of the Deno SDK (and therefore Deno runtime).

One of the simpler, publicly available examples of a workflow-based Slack app is the slack-samples/deno-announcement-bot repository.

Cross-referencing the Slack docs for this sample project, there's a specific part where format the blocks in order to send a message: https://tools.slack.dev/deno-slack-sdk/tutorials/announcement-bot#send-the-announcement

From the code snippets in the doc, they import code from ./blocks.ts, which itself imports @slack/types from Skypack.dev (https://www.skypack.dev/view/@slack/types), but this is really a pointer back to this node-slack-sdk project.

Looking at the source code for blocks.ts, they also have similar exported functions for constructing blocks like I included as an example in bug report.

Let me know if all of this answers your question/helps you reproduce this, or if you need more details.

Thanks!

@WilliamBergamin WilliamBergamin added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented area:typescript issues that specifically impact using the package from typescript projects pkg:types applies to `@slack/types` and removed needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info labels Mar 27, 2025
@WilliamBergamin
Copy link
Contributor

Thanks for reporting this 💯 we will try to address this in the coming release

Copy link

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects auto-triage-skip bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:types applies to `@slack/types`
Projects
None yet
Development

No branches or pull requests

2 participants