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

error TS1192: Module '"http"' has no default export, esModuleInterop #751

Closed
arshad-akra opened this issue Dec 6, 2021 · 2 comments
Closed

Comments

@arshad-akra
Copy link

arshad-akra commented Dec 6, 2021

  • im getting these errors directly upgrading from 0.15.1 to 0.16.1
  • this is similar to This issue on apollo-server
node_modules/@kubernetes/client-node/dist/gen/api/wellKnownApi.d.ts:13:8 - error TS1192: Module '"http"' has no default export.

13 import http from 'http';

node_modules/@kubernetes/client-node/dist/gen/model/models.d.ts:2:8 - error TS1259: Module '"/home/arshad/Code/uphabit/backend/node_modules/@types/request/index"' can only be default-imported using the 'esModuleInterop' flag

2 import localVarRequest from 'request';

attempted fixes

  • setting esModuleInterop: true is throwing 300 errors at all old import * as .... and changing all those is not feasible

  • is there anything else that needs to be set or any other way to overcome this ?
    Thanks

@brendandburns
Copy link
Contributor

This is related to the changes here:
#727

Which were introduced as part of the 0.16.x release.

Specifically:
"esModuleInterop": true

is now set in the tsconfig.

Please see the discussion here about this flag:

microsoft/TypeScript#41139

And here:

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop

I think we are going to retain this flag as part of this library going forward, since that flag appears to be headed to be the default option in typescript as well.

@brendandburns
Copy link
Contributor

If there is any action to take on this library to improve things, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants