[NODE] Cannot find name 'HTMLImageElement' when building with TypeScript
WandersonAlves opened this issue · 3 comments
WandersonAlves commented
Hello!
As said on the title, i can't build a personal typescript project using node-vibrant@3.2.1-alpha.1
.
tsc
output:
yarn run v1.22.5
$ tsc
node_modules/@vibrant/image/lib/index.d.ts:5:44 - error TS2304: Cannot find name 'HTMLImageElement'.
5 export declare type ImageSource = string | HTMLImageElement | Buffer;
~~~~~~~~~~~~~~~~
Found 1 error.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
tsconfig.json:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"types": ["reflect-metadata", "node"],
"outDir": "lib",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"inlineSourceMap": true,
"lib": ["es2017"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
christophersjchow commented
Pretty sure HTMLImageElement
is part of the dom definitions. So include "dom"
in the "lib"
array
vdawg-git commented
I have the same error (its not a type error, it is a runtime error)
Have you found a solution yet? :D
crutchcorn commented
This issue should be fixed as of v4. We're still not StrictMode compliant, but that's coming soon as well