google-photos icon indicating copy to clipboard operation
google-photos copied to clipboard

code is not defined

Open jon-williams-dev opened this issue 3 years ago • 2 comments

Sorry in advance, im new to this...

i have a nextja app and am trying to use google-photos package together with the googleapis package (as recomeded for authorization) ... I am recieveing the following error: "ReferenceError: code is not defined" on: const {tokens} = await oauth2Client.getToken(code);

Any help would be much appreicated. Jon.

jon-williams-dev avatar Sep 22 '21 19:09 jon-williams-dev

It's because it has been written in javascript and there's no support for typescript. You should use require insted of import.

✅ const Photos = require("googlephotos");
❌ import Photos from "googlephotos";

ivenuss avatar Mar 08 '22 14:03 ivenuss

yeah this is something i've been meaning to fix. I need to add TS support 🤔

roopakv avatar Mar 08 '22 18:03 roopakv