I'm attempting to switch to using @slack/events-api with TypeScript and seem to be running into an error that is stating Property 'on' does not exist on type 'SlackEventAdapter' when trying to set up the event handling.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
Select all that apply:
@slack/web-api@slack/events-api@slack/interactive-messages@slack/rtm-api@slack/webhookspackage version: 2.3.1
node version: 12.13.1
OS version(s): Mac OSX
import { createEventAdapter } from '@slack/events-api'const adapter = createEventAdapter(signingSecret)adapter.on('link_shared', (event) => console.log(event)) and see the typescript error
Here is my workaround atm:
const slackEvents: SlackEventAdapter & EventEmitter = createEventAdapter(
slackSigningSecret
) as any;
This is due to a change in the types for Node 13 (see here). Installing @types/[email protected] in my project fixes this for me.
would love a fix for this. I see there's a PR in another issue that fixes this. The issue is that event emitter and http have no default import. The PR looks like it just needs a reviewer to approve it. Thanks for the work on this repo.
@net8floz you are right. I believe https://github.com/slackapi/node-slack-sdk/pull/958 fixed this problem. I'm going to close this issue and aim to get a release out today/tomorrow with the fix.
I'm on node 14 and seeing this. Is there a fix planned before Node 14 becomes current, October 20? Or perhaps this is unique to me?
I'm also facing this problem and installed the @types/[email protected] package as a dev dependency to get rid of the error.
Is there any plan to fix the problem for the latest node type definitions??
Most helpful comment
@net8floz you are right. I believe https://github.com/slackapi/node-slack-sdk/pull/958 fixed this problem. I'm going to close this issue and aim to get a release out today/tomorrow with the fix.