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

494
Vistas
External library not found in typescript build

Good morning everyone, while developing a library I needed to install a third party library to do the job. I tried to modify my tsconfig.json file but it wasn't enough, you can see below the configuration I set (some fields were added as I searched the net):

{
  "compilerOptions": {
    /* Visit https://aka.ms/tsconfig.json to read more about this file */

    /* Language and Environment */
    "target": "ES2021",
     "lib": ["DOM", "ES2021"],
     "experimentalDecorators": true,       
     "emitDecoratorMetadata": true,      

    /* Modules */
    "module": "ES2020",                                
    "rootDir": "./",                                  
    "moduleResolution": "node",                       
    "baseUrl": ".",                                  

    /* JavaScript Support */
    "allowJs": true,  
    "maxNodeModuleJsDepth": 1,  

    /* Emit */
    "outDir": "./dist",                                   

    /* Interop Constraints */
     "allowSyntheticDefaultImports": true,            
    "esModuleInterop": true,                          
    "forceConsistentCasingInFileNames": true,         

    /* Type Checking */
    "strict": true,                                   
    "noImplicitAny": false,                           

    "skipLibCheck": true,                                
  },
  "include":[
    "./node_modules/html2canvas"
  ]
}

However, when I get to the part where I have to use the library during the build phase, it gives me this error in the console:

Uncaught (in promise) ReferenceError: html2canvas is not defined

could you tell me what is solvable? there are other questions about SO but none of them solve my problem.

Would anyone be kind enough to tell me how to fix and where am I wrong?

Thank you so much.

about 4 years ago · Juan Pablo Isaza
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