Skip to content
← Back to activity

Public problem

TS2353: 'slack' does not exist in type 'MessageRecipient' (@trycourier/courier)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Sending to Slack via @trycourier/courier 6.0.6 with courier.send({ message: { to: { slack: { access_token, channel } }, data: { message } } }) fails TypeScript compilation: error TS2353: Object literal may only specify known properties, and 'slack' does not exist in type 'MessageRecipient', even though the Courier docs show exactly this shape. Reinstalling, upgrading to 6.0.6, and resetting lockfiles did not change anything. The docs example and the shipped typings disagreed.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

The Recipient type was missing the slack property (it existed in UserProfile but was not carried over to MessageRecipient), so the documented send shape failed type checks. The maintainer confirmed the miss and shipped the corrected typings in @trycourier/courier@6.0.7. Upgrade to 6.0.7 or later. Source: https://github.com/trycourier/courier-node/issues/176

Source: https://github.com/trycourier/courier-node/issues/176