-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
SSR caching example is broken (UnhandledPromiseRejectionWarning: TypeError: argument entity is required) #16725
Comments
9.5.1 is not working for me 😂 |
Any update on this? |
It is related to:
Not sure what is the plan here, is it safe to still use |
This is so sudden, they've already broken our production application. There should be a quick alternative. |
Refer to @Charioteer‘s ideas Modify the get method of ssr-caching demo get: async ({ req, res }) => {
const rawResEnd = res.end
const data = await new Promise((resolve) => {
res.end = (payload) => {
if (res.statusCode === 200) {
resolve(payload)
} else {
resolve()
}
}
app.render(req, res, req.path, {
...req.query,
...req.params,
})
})
res.end = rawResEnd
return { data }
}, Currently we can write like this first 😊 Since the response needs to be terminated correctly when the |
I have the same error in Next.js rendering with serverless target. I can't see how exactly is this connected to our app code from this stack trace. Is this a problem with the vendor etag package? Versions are:
|
I have the same problem. |
@ppbl Even with that workaround, the issue still occurs. |
We rely on renderToHtml in order to modify the raw html server side before sending it to the client, it seems like that’s on shaky ground. Can we get an alternate solution for rendering out raw HTML using nextjs? |
@leerob seems like example is still broken:
|
Bug report
Describe the bug
The SSR caching login is broken with the error below.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
It should cache pages normally.
System information
Additional context
It was working fine on our project, until it didn't when I upgraded to v9.5.2 from v9.5.1
So I thought of testing the official example, just to find out the same issue!
The text was updated successfully, but these errors were encountered: