The error started to occur after an update from 3.3.0 to 3.4.0 (and exist in 3.5.0 also) in our Typescript application. Adding the DOM to tsconfig.json fixes the problem but DOM is not needed in a backend application. We are using nodejs ver. 12.
We tried downgrading but ultimately ended up with a custom type file.
1) tell TypeScript where to find custom typings
in tsconfig.json:
{
"compilerOptions": {
"typeRoots": ["./node_modules/@types", "./types"]
}
}
in ./types/Blob/index.d.ts:
type Blob = never
I'm also getting this error - I'm using JSZip in custom extension for vscode
node_modules/jszip/index.d.ts:33:11 - error TS2304: Cannot find name 'Blob'.
33 blob: Blob;
~~~~
node_modules/jszip/index.d.ts:45:11 - error TS2304: Cannot find name 'Blob'.
45 blob: Blob;
~~~~
Found 2 errors.
jszip 3.6.0
Most helpful comment
We tried downgrading but ultimately ended up with a custom type file.
1) tell TypeScript where to find custom typings
in
tsconfig.json:in
./types/Blob/index.d.ts: