jszip
jszip copied to clipboard
Error TS2304: Cannot find name 'Blob'
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.
- tell TypeScript where to find custom typings
in tsconfig.json:
{
"compilerOptions": {
"typeRoots": ["./node_modules/@types", "./types"]
}
}
- declare type stub
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
We're facing the same issues on our end as well. We're currently using 3.10.1
Hi @pacholoamit , this issue still exists in 3.10.1.