sanitize-html: Community contribution required: Typescript Compilebreak after updating from nodejs 8 to 12
We used sanitize-html
in a typescript project with node 8.
After upgrading to node 12, the following typescript compilebreaks occurr in sanitize-html and its dependencies:
node_modules/@types/domutils/index.d.ts:6:10 - error TS2614: Module '"../../../../../node_modules/domhandler/lib"' has no exported member 'DomElement'. Did you mean to use 'import DomElement from "../../../../../node_modules/domhandler/lib"' instead?
6 import { DomElement } from "domhandler";
~~~~~~~~~~
node_modules/@types/htmlparser2/index.d.ts:17:10 - error TS2614: Module '"../../../../../node_modules/domhandler/lib"' has no exported member 'DomElement'. Did you mean to use 'import DomElement from "../../../../../node_modules/domhandler/lib"' instead?
17 export { DomElement, DomHandlerOptions, DomHandler, Element, Node } from 'domhandler';
node_modules/@types/sanitize-html/index.d.ts:17:10 - error TS2305: Module '"../../../../../node_modules/htmlparser2/lib"' has no exported member 'Options'.
17 import { Options } from "htmlparser2";
In the package.json
, we are using
"sanitize-html": "^1.20.1",
and
"@types/sanitize-html": "^1.20.2",
for the typings.
Could anyone else update successfully to node 12?
Side-note - maybe it helps:
It seems the dependency htmlparser2
was ported to typescript in https://github.com/fb55/htmlparser2/commit/759b1220c03e55a895f971deab9f1e94c30a7f61 which was released in https://github.com/fb55/htmlparser2/releases/tag/v4.0.0. Still sanitize-html
pulls in "htmlparser2": "^3.10.0",
as dependency.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 24 (9 by maintainers)
This is still broken for me, post upgrade I see the following issues:
I’ve made a PR to
@types/sanitize-html
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/43870, which should resolve the issue withhtmlparser2
types.Still have the same issue on my end too.
I’ve opened an issue asking for some information as to what bc breaks, if any, come with htmlparser2 4.0.0.
On Fri, Dec 27, 2019 at 5:19 AM ceisele-r notifications@github.com wrote:
–
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his
PR is merged now 🎉
Whoops, somehow didn’t push master after publishing, fixed.
On Mon, Feb 24, 2020 at 5:49 PM David Mattia notifications@github.com wrote:
–
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his