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
You have not mentioned what environment you are using, but assuming that you are using latest CRA application, which is using Webpack 5 under the hood, try to use different import for Document and Page components from react-pdf, like this: import { Document, Page } from "react-pdf/dist/esm/entry.webpack";
Docs also provides other options of import paths, if you are using other bundler:
I could not reproduce it on my end, but our error tracking tool caught the similar error
I've recently switched to CRA-5 with React 18 and react-pdf/dist/esm/entry.webpack5
Before you start - checklist
Description
got an error as Failed to load pdf in the screen and the "Uncaught SyntaxError: Unexpected token '<' in pdf.worker.js" in the console.
Steps to reproduce
Expected behavior
The pdf should be visible.
Actual behavior
The pdf is not rendered.
Additional information
No response
Environment
The text was updated successfully, but these errors were encountered: