-
Notifications
You must be signed in to change notification settings - Fork 28
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next 11.1.2 throws TypeError: DocumentComponent.renderDocument is not a function
#263
Comments
TypeError: DocumentComponent.renderDocument is not a function
TypeError: DocumentComponent.renderDocument is not a function
Hi @fracture91. Thanks for reporting 鉂わ笍 It seems that Next.js deeply refactored document rendering, which is the reason why we decided to keep our I see at least 3 options here (sorted by preference):
Since I can't tell how long this will take, I'd like to give option 2 a try in order to not lock all users to next 11.1.1. In the meanwhile any kind of support to get to option 1 is very welcome. |
I've spent a few few hours on the topic: I could get document rendering to work again with still 3 red tests (of which one concerning Since I won't be able to spend so much time on this, I will try to release a working breaking version with Current document rendering implementation heavily relies on next.js internal files. A different approach might consist of re-implementing the minimum document rendering functionality with as little as possible dependencies toward next.js. If possible :) In the meanwhile I'll be happy to support anybody who wanted to give it a try. PR #264 is a good starting point. |
Core functionality against Next.js v11.1.2+ should be restored with v0.29.0. @fracture91 can you confirm that the issue is resolved? |
@toomuchdesign Thanks for looking into this and getting a fix out. I can confirm that the error message shows up as expected, and setting A couple of surprising things happened without
I think for now I'm going to try to stick with next 11.1.0 and next-page-tester 0.28.x so I can keep the |
Hi @fracture91, is point 2 dependent on |
I'm looking for an open bug I can follow, to track when this actually gets fixed. It looks like for the time being the fix was to disable the Is there an open issue tracking this? I did find this open PR, but it's quite old, relative to the Thanks. |
Hi @thepuzzlemaster, |
馃悰 Bug Report
Using
next-page-tester
0.28.0 withnext
11.1.2 (and possibly 11.1.1?) throws the following error withuseDocument: true
:It looks like it's reaching this line of code https://github.com/toomuchdesign/next-page-tester/blob/bbde6b3714805c3e2d002f390ea28fa25aa6f61e/src/_document/render.tsx#L151
But the
renderDocument
function was deleted in this commit :(vercel/next.js@08a2478#diff-5d810eb5cd68f6a6a3597e5472015f0c199e21d97cdabc9f7d5ac3fa85adc369L179
Reproduction
I'm guessing it's trivial enough to bump your
next
version and see your tests failExpected behavior
No errors :)
Jest patch
Have you patched Jest as described here?
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: