SSR caching example is broken (UnhandledPromiseRejectionWarning: TypeError: argument entity is required)
See original GitHub issueBug report
Describe the bug
The SSR caching login is broken with the error below.
(node:14465) UnhandledPromiseRejectionWarning: TypeError: argument entity is required
at etag (/home/omar/Desktop/ssr-caching-app/node_modules/etag/index.js:72:11)
at /home/omar/Desktop/ssr-caching-app/node_modules/cacheable-response/index.js:95:32
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:14465) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14465) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Go to https://github.com/vercel/next.js/tree/canary/examples/ssr-caching
- Run locally
- Access the website
- See error in the terminal (notice the speed and the missing headers in the response)
Expected behavior
It should cache pages normally.
System information
- OS: Ubuntu 18.04
- Browser (if applies): Chrome
- Version of Next.js: 9.5.2(latest)
- Version of Node.js: 12.16.2
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!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Next.js SSR Caching using custom server - Stack Overflow
(node:20872) UnhandledPromiseRejectionWarning: TypeError: argument entity is required at etag (C:\xampp\htdocs\next-app\node_modules\etag\index.
Read more >Next.js Ssr Caching Example - StackBlitz
Run official live example code for Next.js Ssr Caching, created by Vercel on StackBlitz.
Read more >typeerror [err_invalid_arg_type]: the "id" argument must be of type ...
Before continuing with the command, ensure that the required argument is present. If not, return an error message. For example.
Read more >CS3281 - Knowledge gained from Projects - GitHub Pages
For example, if we want to get API data of the authenticated user from ... Since arguments are space-separated, this essentially breaks the ......
Read more >Query: Advanced Search - Wikimedia Phabricator
T147614 Vagrant provision breaks with "Error: your composer.lock file is not up to ... T271758 Support and require BCP 47 tags in <langconvert>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/vercel/next.js/issues/14737#issuecomment-680092517
Refer to @Charioteer‘s ideas
Modify the get method of ssr-caching demo
Currently we can write like this first 😊
Since the response needs to be terminated correctly when the
send
is executed, theres.end
modified inget
needs to be restored@leerob seems like example is still broken: