slackapi / node-slack-sdk

Slack Developer Kit for Node.js
https://tools.slack.dev/node-slack-sdk/
MIT License
3.28k stars 662 forks source link

`MessageEvent` incorrectly references the Node global MessageEvent type. #2020

Closed varmil closed 2 months ago

varmil commented 2 months ago

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Packages:

Select all that apply:

Reproducible in:

package version: 2.13.0

node version: v20.12.1 (or higher)

OS version(s): Win 11

Steps to reproduce:

  1. Install the 2.13.0 package.
  2. Import any Type that uses the MessageEvent type.
  3. Show Property 'attachments' does not exist on type 'MessageEvent<any>'.ts(2339) error.

Expected result:

No errors should occur.

Actual result:

MessageEvent should actually read export type MessageEvent = AllMessageEvents; but instead it references the Node global MessageEvent type.

Attachments:

image

I create PR later

seratch commented 2 months ago

Hi @varmil, thanks for reporting this regression bug. It seems this issue was introduced by this PR https://github.com/slackapi/node-slack-sdk/pull/1907. As you suggested in #2021, moving the line of code for defining the "MessageEvent" type should resolve it. @filmaj, can you take a look at this and make a patch release tomorrow?

filmaj commented 2 months ago

Thank you for this, will certainly merge and release something to address this today. Just thinking through how to test for this to make sure we don't regress...

filmaj commented 2 months ago

This is now fixed in v2.13.1 of @slack/types: https://github.com/slackapi/node-slack-sdk/releases/tag/%40slack%2Ftypes%402.13.1