You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that in TypeScript, the never type infects any types which are joined to it. This means that WithAuth<GetSelfParameters> === Record<string, never> refusing any legitimate parameters. In practice, this means that TypeScript will throw an error for notion.users.me({ auth: AUTH_TOKEN }).
You can fix this by updating your API type generator to emit {} instead of Record<string, never>. It might also be prudent to set the EmptyObject type to {} too, but I haven’t tested that one.
The text was updated successfully, but these errors were encountered:
In
api-endpoints.ts
, we have:notion-sdk-js/src/api-endpoints.ts
Line 9523 in ba87338
The problem is that in TypeScript, the
never
type infects any types which are joined to it. This means thatWithAuth<GetSelfParameters> === Record<string, never>
refusing any legitimate parameters. In practice, this means that TypeScript will throw an error fornotion.users.me({ auth: AUTH_TOKEN })
.You can fix this by updating your API type generator to emit
{}
instead ofRecord<string, never>
. It might also be prudent to set theEmptyObject
type to{}
too, but I haven’t tested that one.The text was updated successfully, but these errors were encountered: