title: Next.js - Is it possible to debug getServerSideProps?
body: <p>Hi as per docs <a href="https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering" rel="noreferrer">getServerSideProps</a> is a function which is executed only on server side.</p>
  <pre><code>export async function getServerSideProps(context) {
    console.log(&quot;hello world&quot;);
    debugger;
    return {
      props: {
        age:55
      }, // will be passed to the page component as props
    }
  }
  </code></pre>
  <p>As a consequence simply dropping a debugger keyword won't work.</p>
  <p>I have tried:</p>
  <ul>
  <li>Attaching the node.js debugger on port 9229</li>
  <li>Running <code>node --inspect-brk ./node_modules/next/dist/bin/next</code></li>
  <li>Running <code>cross-env NODE_OPTIONS='--inspect' next dev</code></li>
  </ul>
  <p>But neither <strong>console.log()</strong> nor <strong>debugger</strong> keyword seem to have any effect.</p>
  <p>However my props from getServerSideProps are passed in correctly, which proves the function is called.</p>
  <p>Is it possible to stepthrough getServerSideProps or at least get console.log working? Thanks!</p>
  <p>P.S.</p>
  <p>The lines of code outside getServerSideProps are debuggable and work as expected.</p>