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 issue #28

Open
abhiaiyer91 opened this issue Aug 18, 2020 · 1 comment
Open

Typescript issue #28

abhiaiyer91 opened this issue Aug 18, 2020 · 1 comment

Comments

@abhiaiyer91
Copy link

abhiaiyer91 commented Aug 18, 2020

Type 'Promise<import("/Users/abhiaiyer/gatsby/mansion/cloud/node_modules/@turist/fetch/node_modules/@types/node-fetch/index").Response>' is not assignable to type 
'Promise<import("/Users/abhiaiyer/gatsby/mansion/cloud/node_modules/@types/node-fetch/index").Response>'.
  Type 'import("/Users/abhiaiyer/gatsby/mansion/cloud/node_modules/@turist/fetch/node_modules/@types/node-fetch/index").Response' is not assignable to type 'import("/Users/abhiaiyer/gatsby/mansion/cloud/node_modules/@types/node-fetch/index").Response'.

Versions node-fetch ^2.6.0, @types/node-fetch ^2.5.7 @turist/fetch ^7.1.6

@jamo
Copy link
Collaborator

jamo commented Aug 25, 2020

I can't easily reproduce the error:

test.ts:

import createFetch from '@turist/fetch';
import fetch from "node-fetch"

const f = createFetch(fetch);
async function doit() {
  const res = await f('http://ip.jamo.fi')
  console.log(res)
}
doit().then(console.log)

package.json:

{
  "name": "fetch-debug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Jarmo Isotalo <[email protected]>",
  "license": "MIT",
  "dependencies": {
    "@turist/fetch": "7.1.7",
    "@types/node-fetch": "2.5.7",
    "async-retry-ng": "2.0.1",
    "node-fetch": "2.6.0",
    "ts-node": "9.0.0",
    "typescript": "4.0.2"
  }
}

./node_modules/.bin/tsc --strict test.ts and ./node_modules/.bin/ts-node test.ts both work fine 🤔

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