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

491
Visualizações
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 à 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