The "node slack sdk" uses "esModuleInterop" for all projects. It makes me fail to compile my own projects. Especially, "event-api" package imports "EventEmitter" from "events" module as default. In this case, projects which set "esModuleInterop" false get compile error like Module '"events"' has no default export..
x in one of the [ ])x in each of the [ ])Select all that apply:
@slack/web-api@slack/events-api@slack/interactive-messages@slack/rtm-api@slack/webhooksHi @Ikanny, thanks for making us aware of this issue! This sounds like the same issue as in #759, except its in the @slack/events-api package instead of @slack/web-api.
My next steps here are to try and reproduce the issue as you described, but also make sure the other packages in this repo work correctly with esModuleInterop turned off. I hope to put these in the integration tests, as we did in #760, so that we don't regress on this in the future.
I was able to reproduce the failure in a scrap project. It only impacts @slack/events-api and @slack/interactive-messages.
Then I made a failing test in the integration tests. I'll open a draft PR for this, but if anyone else would like to pick that PR up and implement the fix, please feel free!
Hi @aoberoi, I opened a PR, please have a look. #923
@saeedseyfi your PR seems to fix one particular use case but does not prevent build failures with external projects where esModuleInterop is set to false.
As for me, when trying to set esModuleInterop to true, I get
node_modules/@slack/events-api/dist/adapter.d.ts:8:48 - error TS2507: Type 'typeof EventEmitter' is not a constructor function type.
8 export declare class SlackEventAdapter extends EventEmitter {