-
-
Notifications
You must be signed in to change notification settings - Fork 906
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
Element type is invalid in PageInternal.render after upgrade to Webpack 4 #248
Comments
Hi, what version of React are you on? |
Hi @wojtekmaj, we use [email protected]. |
I tried to reproduce it and honestly, I'm not even able to get it working on Webpack 4. We gotta wait for Mozilla to make an official release. Then we'll deprecate Webpack 2 and Webpack 4 should be supported just fine. Keeping this open for now. |
Thanks @wojtekmaj! |
Hi, I am running into the same issue using webpack 4, [email protected] and react-pdf 5. Any updates or workarounds on this? |
I'm running into similar issue using webpack 5, [email protected], react-pdf 5.7.2. Did I miss sth obvious?
|
The weird thing I found is...it works in storybook but not in the real code...but I'm calling the same component. Anyone encountered the same error could give me some insight on how it's happening...? |
I've encountered a similar issue to @yeung108. However instead of
My app is quite simple, I am currently just trying to render a single page of a document:
I also checked devtools, and confirmed that I was able to get the static local pdf correctly (attached is the photo of the 200 request) Does anyone have any advice on how to fix this? I have tried different pdfs, importing react-pdf multiple different ways, setting up the pdf.worker in different ways and nothing has helped. Any help would be greatly appreciated! |
Just want to add that if I comment out the ...
const [numPages, setNumPages] = useState<number | null>(null);
const [currentPage, setCurrentPage] = useState<number>(1);
const onDocumentLoadSuccess = (pageNum: number) => {
window.console.log(pageNum) <-- it can successfully print the number of pages of the document
setNumPages(pageNum);
};
<Document
file={url}
onLoadSuccess={(source) => {
onDocumentLoadSuccess(source.numPages);
}}
>
{numPages && <Page pageNumber={currentPage} />}
</Document> So yeah...appreciate if anyone could lend a helping hand here... |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
This issue was closed because it has been stalled for 14 days with no activity. |
Before you start - checklist
Description
After upgrade to webpack 4, when we try to show the PDF, the application resets to blank screen on any browser (see below) and the preserved console log shows an uncaught error
Element type is invalid
inPageInternal.render
. See below for full console log. The same code works ok when built with webpack 3.Steps to reproduce
N/A, the source, where we encounter this issue, is not open.
Expected behavior
Displaying PDF using react-pdf should continue to work after upgrade to webpack4.
Environment
Additional information
Linking to the general webpack 4 compatibility issue #179.
And here's the full log:
The text was updated successfully, but these errors were encountered: