unjs / ofetch

😱 A better fetch API. Works on node, browser and workers.
MIT License
4.14k stars 128 forks source link

TS2305: Module 'ofetch' has no exported member FetchOptions #395

Closed cdwmhcc closed 5 months ago

cdwmhcc commented 5 months ago

Environment

nodejs: 20.13.1 pnpm: 9.1.1 typescript: "5.4.5"

Reproduction

tsconfig.json

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Base",
  "compilerOptions": {
    "strict": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "allowUnusedLabels": false,
    "allowUnreachableCode": false,
    "exactOptionalPropertyTypes": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": false,
    "strictNullChecks": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "allowJs": true,
    "checkJs": true,
    "allowSyntheticDefaultImports": true,
    "declaration": true,
    "module": "Node16",
    "target": "ES2022",
    "moduleResolution": "Node16",
    "verbatimModuleSyntax": true
  }
}

Describe the bug

TS2305: Module 'ofetch' has no exported member FetchOptions

image

Additional context

No response

Logs

No response

cdwmhcc commented 5 months ago
"paths": {
      "ofetch": ["./node_modules/ofetch/dist/index.d.ts"] 
    }

It works.