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

TypeScript Error: has no exported member 'Body'. #119

Closed
balupton opened this issue Aug 13, 2019 · 2 comments
Closed

TypeScript Error: has no exported member 'Body'. #119

balupton opened this issue Aug 13, 2019 · 2 comments
Labels
help wanted needs-more-info information is needed to move forward typescript

Comments

@balupton
Copy link

balupton commented Aug 13, 2019

$ cat node_modules/isomorphic-unfetch/package.json | grep version
  "version": "3.0.0",
$ tsc --noEmit --project .
node_modules/isomorphic-unfetch/index.d.ts:2:3 - error TS2305: Module '"../../../../../../../Users/balupton/Projects/meet/bevry-meet/node_modules/node-fetch/lib"' has no exported member 'Body'.

2   Body as NodeBody,
    ~~~~

node_modules/isomorphic-unfetch/index.d.ts:9:45 - error TS2749: 'NodeHeaders' refers to a value, but is being used as a type here.

9   export type IsomorphicHeaders = Headers | NodeHeaders;
                                              ~~~~~~~~~~~

node_modules/isomorphic-unfetch/index.d.ts:11:47 - error TS2749: 'NodeResponse' refers to a value, but is being used as a type here.

11   export type IsomorphicResponse = Response | NodeResponse;
                                                 ~~~~~~~~~~~~

node_modules/isomorphic-unfetch/index.d.ts:12:45 - error TS2749: 'NodeRequest' refers to a value, but is being used as a type here.

12   export type IsomorphicRequest = Request | NodeRequest
                                               ~~~~~~~~~~~


Found 4 errors.
$ cat node_modules/isomorphic-unfetch/index.d.ts 
import {
  Body as NodeBody,
  Headers as NodeHeaders,
  Request as NodeRequest,
  Response as NodeResponse
} from "node-fetch";

declare namespace unfetch {
  export type IsomorphicHeaders = Headers | NodeHeaders;
  export type IsomorphicBody = Body | NodeBody;
  export type IsomorphicResponse = Response | NodeResponse;
  export type IsomorphicRequest = Request | NodeRequest
}

declare const unfetch: typeof fetch;

export default unfetch;
> cat node_modules/node-fetch/package.json | grep version
  "version": "2.6.0",
@developit
Copy link
Owner

Curious if this still happens in 3.1.0, since it includes #117.

@developit developit added help wanted needs-more-info information is needed to move forward typescript labels Sep 29, 2020
@developit
Copy link
Owner

This should be fixed as of isomorphic-unfetch 4.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted needs-more-info information is needed to move forward typescript
Projects
None yet
Development

No branches or pull requests

2 participants