Replies: 1 comment
-
The only solution that I could think of was to save a file inside the assets folder and call it pdf.worker.min.mjs and then reference it like this: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am using PDF.js in my project which I am doing with Angular and TypeScript, to render a PDF file that I am getting from the backend, page by page. It will be a specialised renderer, that is why I am not using the built in renderer. All of the functions working well and I can execute the client server. However on the console I am getting this warning
Warning: Setting up fake worker.
And this error:
Service worker registration failed with: TypeError: Failed to register a ServiceWorker for scope ('http://localhost:9000/') with script ('http://localhost:9000/ngsw-worker.js'): A bad HTTP response code (404) was received when fetching the script.
I imported PDFJS like this:
I know this is not how I should import the Worker however everytime I try the other options it says 'The module declaration could not be found.'
I tried everything on the internet and nothing worked. I would appreciate your help on this.
IDE: Intellij IDEA 2024
Node version: v20.11.1
TS version: 5.0.2
Web browser and its version
Google Chrome 113.0.5672.126
Operating system and its version
MacOS 14.5
PDF.js version
^4.4.168
Beta Was this translation helpful? Give feedback.
All reactions