Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NODE] Cannot find name 'HTMLImageElement' when building with TypeScript #119

Open
WandersonAlves opened this issue Feb 2, 2021 · 2 comments

Comments

@WandersonAlves
Copy link

Hello!

As said on the title, i can't build a personal typescript project using [email protected].

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
Copy link

Pretty sure HTMLImageElement is part of the dom definitions. So include "dom" in the "lib" array

@vdawg-git
Copy link

vdawg-git commented Aug 9, 2022

I have the same error (its not a type error, it is a runtime error)
Have you found a solution yet? :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants