JWT Class extends value undefined is not a constructor or null in google-auth-library

214 views Asked by At
import { JWT } from 'google-auth-library'

    const jwt = new JWT({
      email: creds.client_email,
      key: creds.private_key,
      scopes: [
        'https://www.googleapis.com/auth/spreadsheets',
        'https://www.googleapis.com/auth/drive.file',
      ],
    })

Trying to get Google auth using JWT in google-auth-library, I've added the types as well as verified that there is a constructor. Still cannot figure out how to solve this issue.

I'm to do this in a tsx file in a react project with Vite.

enter image description here

Screenshot of the error.

0

There are 0 answers