question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incomplete type definition for signInFailure callback return value (TypeScript)

See original GitHub issue

The documentation says that the valid return type for signInFailure callback is Promise<void>|void but the type definition defines only Promise<void>.

Describe your environment

  • Operating System version: Linux
  • IDE: Visual Studio Code 1.50.1
  • TypeScript: 3.9.7
  • Firebase UI version: 4.7.0 (via react-firebaseui 4.1.0)
  • Firebase SDK version: 7.24.0

Steps to reproduce:

Write the following code in IDE:

const firebaseUiConfig: firebaseui.auth.Config = {
  callbacks: {
    signInFailure: (error) => {
      console.log("failure");
    },
  }
};

Expected result:

No errors.

Actual result:

IDE gives error:

Type '(error: AuthUIError) => void' is not assignable to type '(error: AuthUIError) => Promise<void>'.
Type 'void' is not assignable to type 'Promise<void>'.ts(2322)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bojeil-googlecommented, Feb 4, 2021

Oops, this slipped through the cracks. Sorry about that. The fix is merged. We will push the release next week with the fix. FYI: @xil222

1reaction
apaatsiocommented, Jan 12, 2021

@Rafarel Just return an empty Promise

const firebaseUiConfig: firebaseui.auth.Config = {
  callbacks: {
    signInFailure: (error) => {
      console.log("failure");
      return Promise.resolve();
    },
  }
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the best way to deal with Typescript incomplete type ...
d.ts type definition files, there are some methods or functions that I want to use missing in the definition. What is the best...
Read more >
microsoft/microsoft-graph-types - UNPKG
1, // Project: https://github.com/microsoftgraph/msgraph-typescript-typings. 2, // Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph>.
Read more >
TypeScript - Declare a function callback type - Trung Vo
To define the function callback type. You could declare an interface that has a call signature. Or define a new type.
Read more >
https://raw.githubusercontent.com/microsoftgraph/m...
Project: https://github.com/microsoftgraph/msgraph-typescript-typings ... The value none means that no action has been performed on the user * or sign-in so ...
Read more >
Error using WifiNetDevice::SetReceiveCallback - Google Groups
I'm getting this error when trying to setup a callback function for a WifiNetDevice using ... ns3/make-event.h:124:7: error: incomplete type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found