Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
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??

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

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.

about 4 years ago · Juan Pablo Isaza Denunciar

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.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda