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

[plugin-express] use proper TypeScript namespace importing for express #866

Merged
merged 1 commit into from
May 26, 2020

Conversation

KevinLiddle
Copy link
Contributor

My project is using express and bugsnag and I've been upgrading my typescript, express, bugsnag, and other dependencies. After making the necessary changes to my code, I get the following error from plugin-express/types/bugsnag-express.d.ts:

node_modules/@bugsnag/plugin-express/types/bugsnag-express.d.ts:2:8 - error TS1259: Module '"<path to project>/node_modules/@types/express/index"' can only be default-imported using the 'esModuleInterop' flag

2 import express from 'express'
         ~~~~~~~

  node_modules/@types/express/index.d.ts:116:1
    116 export = e;
        ~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

Using the esModuleInterop config option breaks several other of my dependencies, but changing the import to a proper typescript namespace import fixes my issues and I'm able to build again. I don't believe this would be a breaking change for any setup.

@KevinLiddle
Copy link
Contributor Author

travis failed because of:

The DANGER_GITHUB_API_TOKEN/DANGER_BITBUCKETSERVER_HOST/DANGER_GITLAB_API_TOKEN environmental variable is missing
Without an api token, danger will be unable to comment on a PR
Error:  Error: Cannot use authenticated API requests.

Not sure what I can do about that.

@mattdyoung
Copy link
Contributor

Hi @KevinLiddle

Thanks for the PR. We think the change makes sense but we'll need to perform some more testing to confirm there are no other side effects. We'll take a look at this when priorities allow.

Thanks!

@mattdyoung mattdyoung added backlog We hope to fix this feature/bug in the future feature request Request for a new feature labels May 26, 2020
@bengourley bengourley merged commit 46fb969 into bugsnag:next May 26, 2020
@bengourley
Copy link
Contributor

I've tested this and see no problems. Going to ship the fix in a patch release today. Thanks @KevinLiddle for your contribution 🥂

@bengourley bengourley mentioned this pull request May 26, 2020
@KevinLiddle
Copy link
Contributor Author

🥳 thanks @bengourley and @mattdyoung!

@KevinLiddle KevinLiddle deleted the plugin-express-fix-import branch May 26, 2020 14:10
@mattdyoung mattdyoung added released This feature/bug fix has been released and removed backlog We hope to fix this feature/bug in the future labels May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature released This feature/bug fix has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants