devalpha-io / devalpha-node

A stream-based approach to algorithmic trading and backtesting in Node.js
https://devalpha.io
GNU General Public License v3.0
246 stars 40 forks source link

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

Open switchtan opened 2 years ago

switchtan commented 2 years ago

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 commented 2 years ago

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