question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The server crashes when getServerSideProps finishes executing

See original GitHub issue

Bug report

Describe the bug

I’m trying to use next/link to refer to a route that uses getServerSideProps for redirection, and the server crashes when getServerSideProps finishes executing.

To Reproduce

Repository: next.js-bug-redirect Steps to reproduce the behavior:

  1. Go to http://localhost:3000
  2. Click on Home link
  3. See error

Expected behavior

Redirecting back to /about.

Screenshots

Screenshot 2020-07-13 at 14 36 53

System information

  • OS: macOS
  • Browser (if applies): chrome
  • Version of Next.js: 9.4.4
  • Version of Node.js: 14.2.0

Additional context

Tried to run it with next@canary, but it also crashes.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
danawoodmancommented, Jul 15, 2020

Related to #14890 and #12409 I believe

1reaction
rokinskycommented, Jan 10, 2022

@timneutkens sorry, I’ve removed all repositories related to the next.js bugs.

Your reproduction code seems correct except commented writeHead and end calls. This code throws an error with next.js 9.4.4 and nodes 14 and 16 as pointed out in the description issue. However, you are right, with next.js 12.0.7 such redirection just doesn’t apply.

P.S. Despite all, if anyone else comes across this problem then it is highly recommended to use a more idiomatic redirect value that works correctly with the newest next.js versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next.js Tutorial - Part 9 | Data Fetching with getServerSideProps
In this video, we will understand getServerSideProps using code and diagrams! We will look into the differences/similarities between ...
Read more >
Data Fetching: getServerSideProps - Next.js
When does getServerSideProps run. getServerSideProps only runs on server-side and never runs on the browser. If a page uses getServerSideProps , then:.
Read more >
KB326823: MicroStrategy Intelligence Server 10.x crashes ...
KB326823: MicroStrategy Intelligence Server 10.x crashes when executing a document containing a data import cube with a circular reference.
Read more >
nextjs getServerSideProps show loading - Stack Overflow
It looks like nothing happens for 2 seconds (the api delay) and then the content shows. I can see in the network tab...
Read more >
Crash Course with Remix Run which is a NEW Full Stack JavaScript ...
In this video, I will go deeper into the core concepts in @Remix as We build a blog app with Prisma and Sqlite....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found