After generating a new ADF 2.6.0 app with Yeoman, when I try to preview a document I get the following error:
'pdfjsLib' is not defined
main.ts contains the following lines:
main.ts |
---|
import * as pdfjsLib from 'pdfjs-dist'; pdfjsLib.PDFJS.workerSrc = 'pdf.worker.js'; |
Sticking to 2.5.0 for my app
Solved! Go to Solution.
The following helped me:
- npm install pdfjs-dist@latest
- remove those 2 lines from the main.ts
- update "angular.json" asset, from "pdf.worker.js" to "pdf.worker.min.js"
- npm start
We will update the yeoman generator shortly.
Remove those two lines, they are not needed anymore
The lines are removed, but the error is still active.
The following helped me:
- npm install pdfjs-dist@latest
- remove those 2 lines from the main.ts
- update "angular.json" asset, from "pdf.worker.js" to "pdf.worker.min.js"
- npm start
We will update the yeoman generator shortly.
This worked for me too.
Thank you!
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.