Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix ReferenceError and invalid_blocks errors in Slack webhook handler #21294

Closed
@jasonwbarnett

Description

@jasonwbarnett

Problem

The Slack webhook implementation documentation contains two bugs in the example app.js code that prevent messages from being sent to Slack:

1. ReferenceError: body is not defined (Line 118)

In the slackMessage object, the code uses:

text:body,

However, the variablebody is never defined. The extracted variable from the request isbody_markdown (defined on line 92). This causes a ReferenceError when the code runs.

Fix: Change line 118 to:

text:body_markdown,

2. Invalid header block text type (Line 122)

The header block uses an invalid text type:

{type:"header",text:{type:"mrkdwn",text:title_markdown},},

According to Slack's Block Kit API, header blocks only supportplain_text as the text type, notmrkdwn. This causes the Slack API to reject the message with error: "must be a valid enum value [json-pointer:/blocks/0/text/type]"

Fix: Change line 122 to:

text:{type:"plain_text",text:title_markdown},

Impact

These errors prevent the webhook from successfully sending notifications to Slack users, making the feature non-functional.

Proposed Solution

Update the documentation at docs/admin/monitoring/notifications/slack.md with the corrected code examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp