title: Cannot find module 'next' or its corresponding type declarations
body: <p>Getting <code>Cannot find module '' or its corresponding type declarations.</code> when importing in Next.js project.</p>
  <p>This happens on every single import. <a href="https://i.stack.imgur.com/TIW1b.png" rel="noreferrer">Preview</a></p>
  <p>Yarn version : 3.1.0-rc.2<br />
  Next version: 11.1.2</p>
  <p><strong>tsconfig.json:</strong></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;es6&quot;,
      &quot;lib&quot;: [
        &quot;dom&quot;,
        &quot;dom.iterable&quot;,
        &quot;esnext&quot;
      ],
      &quot;allowJs&quot;: true,
      &quot;skipLibCheck&quot;: true,
      &quot;strict&quot;: true,
      &quot;forceConsistentCasingInFileNames&quot;: true,
      &quot;noEmit&quot;: true,
      &quot;esModuleInterop&quot;: true,
      &quot;module&quot;: &quot;esnext&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;experimentalDecorators&quot;: true,
      &quot;resolveJsonModule&quot;: true,
      &quot;isolatedModules&quot;: true,
      &quot;importHelpers&quot;: true,
      &quot;jsx&quot;: &quot;preserve&quot;,
      // &quot;baseUrl&quot;: &quot;src&quot;
    },
    &quot;include&quot;: [
      &quot;next-env.d.ts&quot;,
      &quot;**/*.ts&quot;,
      &quot;**/*.tsx&quot;
    ],
    &quot;exclude&quot;: [
      &quot;node_modules&quot;
    ],
  }
  </code></pre>