lukasgeiter / gettext-extractor

A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML.
MIT License
98 stars 21 forks source link

Typescript errors #25

Closed jwalton closed 5 years ago

jwalton commented 5 years ago

I just added gettext-extractor to my project, but I get the following complaints from typescript when I try to build:

node_modules/gettext-extractor/dist/html/parser.d.ts(4,35): error TS2694: Namespace '"/Users/jwalton/benbria/loop/node_modules/parse5/lib/index"' has no exported member 'DefaultTreeNode'.
node_modules/gettext-extractor/dist/html/parser.d.ts(5,39): error TS2694: Namespace '"/Users/jwalton/benbria/loop/node_modules/parse5/lib/index"' has no exported member 'DefaultTreeTextNode'.
node_modules/gettext-extractor/dist/html/parser.d.ts(6,38): error TS2694: Namespace '"/Users/jwalton/benbria/loop/node_modules/parse5/lib/index"' has no exported member 'DefaultTreeElement'.
jwalton commented 5 years ago

Digging into this a little further, I'm using an old version of css-loader which has a dependency on an old jsdom which has a dependency on parse5@4.0.0. Since this is in my node_modules tree, and parse5@4.0.0 shipped with an index.d.ts file, tsc is picking this up instead of the correct one from @types/parse5. :/

Anyways, nothing to do with you, so I'll close this. :)

lukasgeiter commented 5 years ago

That's unfortunate... Let me know if I can help in any way.

jwalton commented 5 years ago

My css-loader dep is in a child project, where it should be a dev-dependancy instead of a real dependancy, so this should be an easy fix. But Travis just ran out of RAM trying to build my (tiny) child project. This apparently isn't my day. :P But thanks for writing this project. We have this ancient project which was written by one of our co-ops many years ago, but it only supports ES5 and it's starting to badly show it's age. Your project should be nearly a drop-in replacement. :)