BetterTyped / hyper-fetch

⚡ Fetching and realtime data exchange framework.
https://hyperfetch.bettertyped.com/
Apache License 2.0
1.03k stars 28 forks source link

Issue with typescript/vscode finding types #71

Closed Darkle closed 1 year ago

Darkle commented 1 year ago

Describe the bug Issue with typescript/vscode finding types

To Reproduce After installing via: npm i @hyper-fetch/core, I get the following error message in vscode:

vsc

Looking at the hyper-fecth package.json after installation, the exports section looks like this:

  "exports": {
    ".": {
      "types": {
        "import": "./index.d.ts"
      },
      "browser": {
        "require": "./dist/browser/index.cjs.js",
        "import": "./dist/browser/index.esm.js"
      },
      "default": {
        "require": "./dist/index.cjs.js",
        "import": "./dist/index.esm.js"
      }
    },
    "./package.json": "./package.json"
  },

It looks like "import": "./index.d.ts" should in fact be "import": "./dist/index.d.ts"

Expected behavior It should find the types.

Desktop (please complete the following information):

stefanullinger commented 1 year ago

Hi, I am running into the same issue right now.

Started a new vite project with TypeScript and React, installed Hyperfetch and got the TS 7016 error.