next.js: Random 500 internal server error in production build on page refresh

Problem: In production build, I get a random 500 server error on production when I refresh a page. It stays there for around 5-10 reloads and then goes away. Client side routing works though. This occurs in my personal website https://iabhishek.dev randomly. On inspection, the following code gives errors randomly (line 290)

Screenshot 2020-01-27 at 1 24 57 PM

Code for my website can be found at https://github.com/abhi12299/website

The following is my code for getInitialProps in / page:

code

The getCookie function:

code

The authenticate function:

code

The getLatestPosts function:

code

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 19 (9 by maintainers)

Most upvoted comments

@hems Did you find something regarding the issue? It was a real pain for me back then.