Currently in the process of migrating a passport JS Google OAuth2 strategy from JavaScript to TypeScript, encountering a TypeScript compile error. The clientID and ClientSecret fields are showing no overload matching the call. Despite both options being defined as string in the interface.
The detailed error message is as below:
TSError: ⨯ Unable to compile TypeScript: middleware/passport.google.ts:12:5 - error TS2769: No overload matches this call. The last overload gave the following error. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.
An actual image showing the issue can be viewed here:
https://i.sstatic.net/Mbode.jpg
Refer to the interface here for more clarity:
https://i.sstatic.net/ntklG.jpg
Any suggestions or solutions?