Yarn 2 & getServerSideProps props test case

What is this?

Returning {notFound: true} in a page's getServerSideProps in Next.js while using Yarn 2 results in the page never loading.

Prerequisites

  • Node 15.13.0
  • Yarn 1.22.10

Reproduction

  1. Clone this
  2. Run yarn install
  3. Run yarn run dev
  4. Navigate to http://localhost:3000/test which should show the Next.js 404 page, which is expected
  5. Stop the server
  6. Run yarn set version berry
  7. Run yarn install
  8. Run yarn run dev
  9. Navigate to http://localhost:3000/test will hang forever and maybe show Webpack errors on the console