close
The Wayback Machine - https://web.archive.org/web/20200828091517/https://github.com/slackapi/node-slack-sdk/issues/872
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about to set false 'esModuleInterop' on tsconfig.json? #872

Open
Ikanny opened this issue Sep 26, 2019 · 4 comments · May be fixed by #923
Open

How about to set false 'esModuleInterop' on tsconfig.json? #872

Ikanny opened this issue Sep 26, 2019 · 4 comments · May be fixed by #923

Comments

@Ikanny
Copy link

@Ikanny Ikanny commented Sep 26, 2019

Description

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..

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

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

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

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/events-api
  • @slack/interactive-messages
  • @slack/rtm-api
  • @slack/webhooks
  • I don't know
@Ikanny Ikanny changed the title How about set false 'esModuleInterop' on tsconfig.json? How about to set false 'esModuleInterop' on tsconfig.json? Sep 27, 2019
@aoberoi
Copy link
Member

@aoberoi aoberoi commented Nov 15, 2019

Hi @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.

@aoberoi
Copy link
Member

@aoberoi aoberoi commented Nov 15, 2019

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!

saeedseyfi added a commit to saeedseyfi/node-slack-sdk that referenced this issue Dec 4, 2019
@saeedseyfi saeedseyfi linked a pull request that will close this issue Dec 4, 2019
2 of 2 tasks complete
@saeedseyfi
Copy link

@saeedseyfi saeedseyfi commented Dec 4, 2019

Hi @aoberoi, I opened a PR, please have a look. #923

@AmazingTurtle
Copy link

@AmazingTurtle AmazingTurtle commented Mar 27, 2020

@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 {
@stevengill stevengill added this to Backlog in Slack Node SDK Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Slack Node SDK
  
Backlog
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.