-
-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.1] - Webpack PDF.js worker fails to load public application url #530
Comments
I also experienced this problem when attempting to upgrade to webpack 4.42.1. I am unsure whether it is related, but I am also receiving the following message during the build:
|
same here |
I think its caused by webpack-contrib/worker-loader#96 |
Please kindly check React-PDF These changes should result in 10-15 seconds faster Webpack builds, as well as you should be able to use Webpack entry file in Create-React-App, without the need of using external CDN for hosting worker. Let me know what you think in #748! |
Description
When following the documentation on how to enable the PDF.js worker for performance I enabled the
import { Document } from 'react-pdf/dist/entry.webpack';
for webpackThe worker will fail to load returning a
GET /node/pdf.worker.js 404 (Not Found)
when loading a url from our public asset section. Also tried this with a simple file hosting server with a ngrok url to connect things. Same result.Adding the external CDN fix resolved the issue.
Steps to reproduce
import { Document } from 'react-pdf/dist/entry.webpack';
Expected behavior
When using the following code according to documentation, I expected to be able to import the
react-pdf/dist/entry.webpack
and have the pdf worker loaded.Additional information
Environment
The text was updated successfully, but these errors were encountered: