itsterry PRO said almost 3 years ago on PDF Reader :
Great ep, Dave: thank you!

Giedrius FLT said about 2 years ago on PDF Reader :
Has anyone tried adopting it with import-maps? 
I get:

Failed to register controller: pdf-reader (controllers/pdf_reader_controller)
TypeError: Module name, 'pdfjs-dist/build/pdf' does not resolve to a valid URL.

Vchekryzhov said over 1 year ago on PDF Reader :
Has anyone adopted it with importmap? I get error Failed to register controller: TypeError: Failed to resolve module specifier "pdfjs-dist/build/pdf". Relative references must start with either "/", "./", or "../".

capripot said over 1 year ago on PDF Reader :
If you encounter issues with the import statement, make sure to use `pdfjs-dist` version `3.11.174` maximum, that resolved it for me!

nielsonrolim PRO said about 1 year ago on PDF Reader :
In version 5.0.375 there is no pdf.worker.entry.js file anymore. Only the pdf.worker.mjs file.

I managed to make it work with this workaround:
import workerSource from 'pdfjs-dist/build/pdf.worker.min.mjs?raw';

// (...)

  connect() {
    const blob = new Blob([workerSource], { type: 'application/javascript' });
    GlobalWorkerOptions.workerSrc = URL.createObjectURL(blob);
    this.loadPdf();
  }


Login to Comment