Google can't find my keyfilePath in my NextJS app?

14 views Asked by At

I am trying to authenticate with @google-cloud/local-auth in a NextJS app. I am using the authenticate method, which takes 2 arguments, keyfilePath and scopes.

I can read the file from the keyfilePath, but when I pass it as an argument to google, I get the error Error: Cannot find module . Here is the code.

      const values = await readFile(CREDENTIALS_PATH, "utf-8");
      console.log("values", values);
      const newClient = await authenticate({
        scopes: SCOPE,
        keyfilePath: CREDENTIALS_PATH,
      });

I can read the values from the CREDENTIALS_PATH. The file logs out as expected. When I use the same path in the authenticate function, I get Error: Cannot find module .

Can someone please point out what I am doing wrong?

0

There are 0 answers