Closed
Description
Describe the bug
If I add import { fetch } from "cross-undici-fetch";
to my .ts file, I get the following compile error:
> tsc -v && tsc --build && babel ./src --out-dir ./dist --extensions ".ts,.js"
Version 4.5.5
../../node_modules/.pnpm/[email protected]/node_modules/cross-undici-fetch/dist/index.d.ts:12:23 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
12 declare const _Blob = Blob;
~~~~
../../node_modules/.pnpm/[email protected]/node_modules/cross-undici-fetch/dist/index.d.ts:13:23 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
13 declare const _File = File;
I'm stick to this package, because @graphql-tools/url-loader 7.7.1
has a dependecy to this package. If I want to use cross-fetch
instead, it's not working, becauseof error TS2451: Cannot redeclare block-scoped variable '_fetch'.
etc.
Environment:
- OS: Linux (WSL)
package-name...
: "cross-undici-fetch": "^0.1.23",- NodeJS: 16
- Typescript 4.5.5
Metadata
Metadata
Assignees
Labels
No labels