taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

TS2416: Property 'parentNode' in type 'HTMLElement' is not assignable to the same property in base type 'Node'. #99

Closed lhein closed 3 years ago

lhein commented 3 years ago

We are trying to switch from version 2.1.0 to 3.0.1 and see the following error in the CI log...it seems unrelated to our own codebase. Any idea?

#!/bin/bash -eo pipefail
npm run vscode:prepublish

> vscode-didact@0.3.2 vscode:prepublish /home/circleci/vscode-didact
> npm run clean && npm run compile

> vscode-didact@0.3.2 clean /home/circleci/vscode-didact
> rm -rf out || rmdir out /s /q

> vscode-didact@0.3.2 compile /home/circleci/vscode-didact
> tsc -p ./

node_modules/node-html-parser/dist/nodes/html.d.ts:25:5 - error TS2416: Property 'parentNode' in type 'HTMLElement' is not assignable to the same property in base type 'Node'.
  Type 'HTMLElement | null' is not assignable to type 'Node'.
    Type 'null' is not assignable to type 'Node'.

25     parentNode: HTMLElement | null;
       ~~~~~~~~~~

Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! vscode-didact@0.3.2 compile: `tsc -p ./`
npm ERR! Exit status 2
taoqf commented 3 years ago

3.0.2 published.

lhein commented 3 years ago

Thank you for the fast fix!