Next.js: Redirect in getStaticProps fails with 500

Created on 14 Nov 2020  路  2Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Redirect fails in the build on 2nd attempt.

To Reproduce

  1. Clone https://github.com/gurisko/nextjs-redirect-bug-hunt
  2. Run yarn build.
  3. Run yarn start.
  4. Go to http://localhost:3000/test. You should be redirected to http://localhost:3000/forbidden.
  5. Go to http://localhost:3000/test.
  6. See 500 in the UI and error TypeError: argument entity must be string, Buffer, or fs.Stats in the console.

Expected behavior

You should be redirected to http://localhost:3000/forbidden.

System information

  • OS: Debian 9
  • Version of Next.js: 10.0.1
  • Version of Node.js: 12.18.1

More information can be found in the README of the repo.

bug

Most helpful comment

Hi, this is fixed in the latest canary of Next.js v10.0.2-canary.17 specifically this PR, please update and give it a try!

All 2 comments

Hi, this is fixed in the latest canary of Next.js v10.0.2-canary.17 specifically this PR, please update and give it a try!

Thank you @ijjk. That indeed fixes the problem!

Was this page helpful?
0 / 5 - 0 ratings