Relative Content

Tag Archive for javascriptreactjspdfreact-pdf

react-pdf – production build produces minified JS file with improper require paths

I’m using react-pdf to render a PDF file from a web URL. The app works fine when doing local development, but fails to render when doing a production build. The root of the issue is that the pdf.min.worker.js file produced by the build has hard-coded file paths in its require statements that reference the file system of the machine that did the build. For example: