title: How to resolve this typescript error on global node.js object
body: <p>I am following this guide <a href="https://vercel.com/guides/nextjs-prisma-postgres" rel="nofollow noreferrer">https://vercel.com/guides/nextjs-prisma-postgres</a> to create a full stack app. Typescript is throwing an error in this snippet of code:</p>
  <pre><code>import { PrismaClient } from '@prisma/client';
  let prisma: PrismaClient;
  
  if (process.env.NODE_ENV === 'production') {
    prisma = new PrismaClient();
  } else {
    if (!global.prisma) {
      global.prisma = new PrismaClient();
    }
    prisma = global.prisma;
  }
  
  export default prisma;
  
  </code></pre>
  <p>TypeScript is throwing a <code>ts7017</code> on the <code>global.prisma</code>:</p>
  <pre><code>Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
  </code></pre>
  <p>Can someone help me understand this and how to fix? I set 'strict' to false in the tsconfig for the meantime and that supressed the issue for the meantime, though I'm sure having it off defeats the purpose of TS.</p>