title: Firebase error - SyntaxError: Named export 'SDK_VERSION' not found
body: <p>I am building a web app using Next.js, and I am using Firestore as my database and thus Firebase, I am connecting to the database with the following code:</p>
  <pre><code>
  import firebase from 'firebase/compat/app'
  import 'firebase/firestore'
  import firebaseConfig from './firebaseConfig'
  
  
  export default () =&gt; {
      if (!firebase.apps.length) firebase.initializeApp(firebaseConfig);
      return firebase.firestore()
  }
  
  </code></pre>
  <p>And it throws the following error:</p>
  <pre><code>
  error - SyntaxError: Named export 'SDK_VERSION' not found. The requested module '@firebase/app' is a CommonJS module, which may not support all module.exports as named exports.
  CommonJS modules can always be imported via the default export, for example using:
  
  import pkg from '@firebase/app';
  const { _getProvider, getApp, _removeServiceInstance, _registerComponent, registerVersion, SDK_VERSION: SDK_VERSION$1 } = pkg;
  
  
  </code></pre>
  <p>Any help?</p>
  <p><strong>EDIT</strong></p>
  <p>As has asked @Dharmaraj  I'll add my package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;hey-there&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;next dev&quot;,
      &quot;build&quot;: &quot;next build&quot;,
      &quot;start&quot;: &quot;next start&quot;,
      &quot;lint&quot;: &quot;next lint&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@auth0/nextjs-auth0&quot;: &quot;^1.7.0&quot;,
      &quot;@emotion/react&quot;: &quot;^11.9.0&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.8.1&quot;,
      &quot;@mui/icons-material&quot;: &quot;^5.6.1&quot;,
      &quot;firebase&quot;: &quot;^9.7.0&quot;,
      &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
      &quot;next&quot;: &quot;12.1.5&quot;,
      &quot;react&quot;: &quot;18.0.0&quot;,
      &quot;react-dom&quot;: &quot;18.0.0&quot;,
      &quot;sass&quot;: &quot;^1.50.0&quot;,
      &quot;socket.io-client&quot;: &quot;^4.4.1&quot;,
      &quot;swr&quot;: &quot;^1.3.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@types/jsonwebtoken&quot;: &quot;^8.5.8&quot;,
      &quot;@types/node&quot;: &quot;17.0.24&quot;,
      &quot;@types/react&quot;: &quot;18.0.5&quot;,
      &quot;@types/react-dom&quot;: &quot;18.0.1&quot;,
      &quot;eslint&quot;: &quot;8.13.0&quot;,
      &quot;eslint-config-next&quot;: &quot;12.1.5&quot;,
      &quot;socket.io&quot;: &quot;^4.4.1&quot;,
      &quot;typescript&quot;: &quot;4.6.3&quot;
    }
  }
  
  </code></pre>