facebook-nodejs-business-sdk icon indicating copy to clipboard operation
facebook-nodejs-business-sdk copied to clipboard

Getting a problematic warning when using the latest @types version

Open amit-toren opened this issue 8 months ago • 0 comments

Which SDK version are you using?

20.0.0 (18.0.4 for @types/facebook-nodejs-business-sdk)

What's the issue?

Getting this issue when running tsc on my project: /@[email protected]/node_modules/@types/facebook-nodejs-business-sdk/src/objects/businessdataapi/event-request.d.ts (37,9): The return type of a 'get' accessor must be assignable to its 'set' accessor type Type 'undefined' is not assignable to type 'string'.

The issue stems from these lines of code:

/**
* Gets the partner_agent for the request
* Allows you to specify the platform from which the event is sent e.g. Zapier
*/
get partner_agent(): string | null | undefined;
/**
* Sets the partner_agent for the request
* Allows you to specify the platform from which the event is sent e.g. Zapier
* @param {String} partner_agent String value for the partner agent
*/
set partner_agent(partner_agent: string);

As you can see, the types don't match, as opposed to the previous @types version (15.0.2):

get partner_agent(): string | null | undefined;
set partner_agent(partner_agent: string | null | undefined);

Where they do match.

amit-toren avatar Jun 20 '24 16:06 amit-toren