title: NextJS Error: Your `getServerSideProps` function did not return an object
body: <p>I have a reddit like application. The node/express TypeORM server with postgres db is on Heroku. The client with Next.js is on Vercel. Registration, comments, upvote/downvote are working fine. When I try to create a new community I get the following error:</p>
  <blockquote>
  <p>502: BAD_GATEWAY
  Code: NO_RESPONSE_FROM_FUNCTION
  ID: cdg1::lrlvg-1612986052014-c0b0a2cd09ac</p>
  </blockquote>
  <p>In Vercel function logs or on PC in terminal I get an error:</p>
  <blockquote>
  <p>Error: Your <code>getServerSideProps</code> function did not return an object.
  Did you forget to add a <code>return</code>?</p>
  </blockquote>
  <p>The code:</p>
  <pre><code>export const getServerSideProps: GetServerSideProps = async ({ req, res }) =&gt; {
    try {
      const cookie = req.headers.cookie
      if (!cookie) throw new Error('Missing auth token cookie')
  
      await Axios.get('/auth/me', { headers: { cookie } })
  
      return { props: {} }
    } catch (err) {
      res.writeHead(307, { Location: '/login' }).end()
    }
    
  }
  </code></pre>
  <p>When I run the client and the server on PC it works, but when deployed I get the error posted above.</p>