Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

496
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!