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

639
Views
¿Cómo puedo corregir este mensaje de error con pdfjs-dist y angular?

Instalo pdfjs-lib en el proyecto angular para convertir PDF a lienzo después de recibir este mensaje de error:

 Error: ./node_modules/pdfjs-dist/build/pdf.js 2094:26 Module parse failed: Unexpected token (2094:26) File was processed with these loaders: * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js * ./node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | async destroy() { | this.destroyed = true; > await this._transport?.destroy(); | this._transport = null; |

el objetivo es convertir la página PDF en lienzo antes de renderizar en HTML:

 import * as pdfjslib from 'pdfjs-dist'; pdfjslib.getDocument(url).promise.then(async(pdf) => { pdf.getPage(1).then(async (page) => { let viewport = page.getViewport({ scale: 0.3 }); let canvas =<HTMLCanvasElement> document.getElementById("card"+pageId); let context =<CanvasRenderingContext2D> canvas.getContext("2d"); canvas.width = viewport.width; canvas.height = viewport.height; await page.render({ canvasContext: context, viewport: viewport }); resolve("ok"); }).catch((err) => { reject("Erreur sur le pdf!!"); }); }).catch((err) => { reject("Erreur sur le pdf!!"); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su configuración de compilación no admite el encadenamiento de opciones.

Debe intentar usar una carpeta heredada, como esta: importar desde la carpeta de compilación heredada

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