title: Can't override Express Request User type, but I can add new properties to Request
body: <p>This is a typical issue with what seems like a common solution. The Express Request object has a property named user which is typed as Express.User (an empty object).</p>
  <p>I try the common solution used to retype it:</p>
  <pre class="lang-js prettyprint-override"><code>// index.d.ts
  
  import { User as PrismaUser, Profile } from &quot;@prisma/client&quot;;
  
  declare global {
    namespace Express {
      export interface Request {
        user: PrismaUser &amp; { profile: Profile };
      }
    }
  }
  
  </code></pre>
  <p>That file is captured by my <code>tsconfig.json</code> file.</p>
  <p>When I do the above, I get the following error:</p>
  <blockquote>
  <p>All declarations of 'user' must have identical modifiers.ts(2687)</p>
  <p>Subsequent property declarations must have the same type.  Property
  'user' must be of type 'User', but here has type 'User &amp; { profile:
  Profile; }'.</p>
  </blockquote>
  <p>Essentially, I'm being told that it has to be typed as Express.User.</p>
  <p>Meanwhile, the following works:</p>
  <pre class="lang-js prettyprint-override"><code>declare global {
    namespace Express {
      export interface Request {
        currentUser: PrismaUser &amp; { profile: Profile };
      }
    }
  }
  </code></pre>
  <p>I could then use <code>request.currentUser</code> in my code.</p>
  <p>Why can't I change the type of the user property though like so many other answers I see given here? I don't see anyone else running into my error. Perhaps my tsconfig is broken?</p>