remarkablemark/html-react-parser

typescript error TS1005: ',' expected.

ldr-dev opened this issue ยท 8 comments

Hello, first of all thank you for this package. I'm having a problem with it. When I run yarn tsc --noEmit

node_modules/htmlparser2/lib/index.d.ts:2:23 - error TS1005: ',' expected.

2 export { Parser, type ParserOptions };
                         ~~~~~~~~~~~~~

node_modules/htmlparser2/lib/index.d.ts:4:27 - error TS1005: ',' expected.

4 export { DomHandler, type DomHandlerOptions };
                             ~~~~~~~~~~~~~~~~~

node_modules/htmlparser2/lib/index.d.ts:32:37 - error TS1005: ',' expected.

32 export { default as Tokenizer, type Callbacks as TokenizerCallbacks, } from "./Tokenizer.js";
                                        ~~~~~~~~~

it gives these errors. How can he solve this? Thanks.

Can you update your tsconfig.json to exclude node_modules?

I'm already doing this. But it doesn't work.
"exclude": ["node_modules/**"],
There is no such problem before version 2.0.0 of this package, but after 2.0.0 this problem is experienced.

You'll have to upgrade TypeScript. See:

Is it a problem to use version 2.0.0?

There is no problem but all new updates will be on the latest version

Thank you very much for your answers. I can't update the typescript version for now. When I update the Typescript package, I will use the latest version of this package.

Thank you very much for your answers. I can't update the typescript version for now. When I update the Typescript package, I will use the latest version of this package.

what was your solution then?

@SalahAdDin I believe the person who opened the issue decided to use html-react-parser v2 instead of upgrading to the latest version