You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked sample and test suites to see real life basic implementation
I have checked if this question is not already asked (already asked, but not exactly like mine )
What are you trying to achieve? Please describe.
Trying to use react-pdf with importing via import { Document, Page } from 'react-pdf/dist/entry.webpack';
Get an error GET http://localhost:9000/rewritten/deep/route/91d10c18b9b34c233fe3.worker.js 404 (not found)
when the react-router set url is at http://localhost:9000/rewritten/deep/route/
The 91d10c18b9b34c233fe3.worker.js is available at http://localhost:9000/static/myapp/91d10c18b9b34c233fe3.worker.js /static/myapp/vendors~pdfjsWorker.main.js also exists. The react app itself is at /static/myapp/main.js.
Describe solutions you've tried
I have tried setting:
pdfjs.GlobalWorkerOptions.workerSrc = '/static/myapp/vendors~pdfjsWorker.main.js';
``` which results in one successful load followed by 404 when trying to get `http://localhost:9000/rewritten/deep/route/vendors~pdfjsWorker.main.js`
**Additional information**
```import { pdfjs } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; ```
Works for me, but I want to not rely on the one on the cdn if possible.
**Environment**
- Browser (if applicable) Chrome 73:
- React-PDF version 4.0.5:
- React version 16.5.2:
- Webpack version 4.4.19:
- React Router 5.0.0
The text was updated successfully, but these errors were encountered:
Before you start - checklist
What are you trying to achieve? Please describe.
Trying to use react-pdf with importing via
import { Document, Page } from 'react-pdf/dist/entry.webpack';
Get an error
GET http://localhost:9000/rewritten/deep/route/91d10c18b9b34c233fe3.worker.js 404 (not found)
when the react-router set url is at
http://localhost:9000/rewritten/deep/route/
The
91d10c18b9b34c233fe3.worker.js
is available athttp://localhost:9000/static/myapp/91d10c18b9b34c233fe3.worker.js
/static/myapp/vendors~pdfjsWorker.main.js
also exists. The react app itself is at/static/myapp/main.js
.Describe solutions you've tried
I have tried setting:
The text was updated successfully, but these errors were encountered: