Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

474
Visualizações
Module '"domhandler"' has no exported member 'DomElement'. Did you mean to use 'import DomElement from "domhandler"' instead?

I trying to build a react-typescript project. ii didn't install dom utils and HTML parser libraries. but when I tried to run yarn build, the following error is coming

       ~~~~~~~~~~

../node_modules/@types/htmlparser2/index.d.ts:17:10 - error TS2614: Module '"domhandler"' has no exported member 'DomElement'. Did you mean to use 'import DomElement from "domhandler"' instead?

17 export { DomElement, DomHandlerOptions, DomHandler, Element, Node } from 'domhandler';
            ~~~~~~~~~~

../node_modules/@types/react-html-parser/index.d.ts:9:10 - error TS2305: Module '"htmlparser2"' has no exported member 'DomElement'.

9 import { DomElement } from "htmlparser2";

I tried some of follwoing steps,

added "skipLibCheck": true in tsconfig.json file

https://github.com/apostrophecms/sanitize-html/issues/333 i tried some steps whatever they said, still no use.

tsconfig.json file

{
  /* https://www.typescriptlang.org/docs/handbook/react-&-webpack.html */
  /* https://www.typescriptlang.org/docs/handbook/compiler-options.html */
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs" /* webpack supports imports syntax */,
    "jsx": "react",
    "lib": ["es5", "dom", "es2015"],
    "strict": true,
    "moduleResolution": "node" /* load modules like node */,
    "esModuleInterop": true /* to treat commonJS 'module.exports' as 'default export' */,
    "importHelpers": true,
    "skipLibCheck": true,
  }
}

This might be a duplicate question. But I don't know how to solve this issue, can someone help me for solving this??

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Remove your current node_modules folder and package-lock.json file. Then after run the command,

npm cache clean --force

Then again install all the npm package

npm i

Better If you can keep -> "skipLibCheck": true in tsconfig.json. will help to resolve this issue further.

Then Try to Build the project again. Hopefully, the issue will be resolved.

over 4 years ago · Santiago Trujillo Relatório

0

If you have these errors just check your package.json. Possibly you installed unwanted type definitions because htmlparser2 package has all necessary type definitions from the box.

If so then delete it and use @Kasunaz's answer.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda