Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

error TS2304: Cannot find name 'Element'. #18

Open
switchtan opened this issue Oct 15, 2021 · 1 comment
Open

error TS2304: Cannot find name 'Element'. #18

switchtan opened this issue Oct 15, 2021 · 1 comment

Comments

@switchtan
Copy link

while run npm run build
will show error like below
`../../node_modules/@types/sizzle/index.d.ts:19:53 - error TS2304: Cannot find name 'Element'.

19 matches(selector: string, elements: Element[]): Element[];
~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:41:48 - error TS2304: Cannot find name 'Element'.

41 (match: RegExpMatchArray, context: Element | Document, isXML: boolean): Element[] | void;
~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:41:58 - error TS2304: Cannot find name 'Document'.

41 (match: RegExpMatchArray, context: Element | Document, isXML: boolean): Element[] | void;
~~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:41:85 - error TS2304: Cannot find name 'Element'.

41 (match: RegExpMatchArray, context: Element | Document, isXML: boolean): Element[] | void;
~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:73:20 - error TS2304: Cannot find name 'Element'.

73 (elem: Element): boolean;
~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:81:24 - error TS2304: Cannot find name 'Element'.

81 (elements: Element[], argument: number, not: boolean): Element[];
~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:81:68 - error TS2304: Cannot find name 'Element'.

81 (elements: Element[], argument: number, not: boolean): Element[];
~~~~~~~`

@switchtan
Copy link
Author

to fix it can use
Yes adding "dom" to the lib array in tsconfig.json solved the problem
the solution from URL

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

No branches or pull requests

1 participant