'How can solve this error "Uncaught TypeError: inputArgs[0].match is not a function"

When login first then immediatly show:- "Uncaught TypeError: inputArgs[0].match is not a function" this error .

I'm using react-firebase-auth hook. when I try loging it login successfully . my code like as=

import useSignInWithGoogle form react-firebase-hooks
const [signInWithGoogle, user, loading, error] =useSignInWithGoogle(auth);
if (user) {console.log(user)} 

it show first 2 result like -UserCredentialImpl and then show:

Uncaught TypeError: inputArgs[0].match is not a function

and the again show UserCredentialImpl and again:

Uncaught TypeError: inputArgs[0].match is not a function



Solution 1:[1]

1.npm -g firebase-tools and npm firebase-tools or yarn add firebase-tools 2.do not console.log() directly to authState(auth) or useAuthState (auth) user

3.try to put it on condition

  const [signInWithGoogle, googleuser, googleloading, googleerror] =
useSignInWithGoogle(auth) if (googleuser) {
console.log(googleuser)};

or console.dir() instead of console.log()

Solution 2:[2]

I'm also getting the same error! today. Alternatively, you can try a different browser like Mozila / Safari / Brave. Or you can use console.dir() instead of console.log(). Or you can you add a string before log like: console.log("data", user)

Solution 3:[3]

so easy disabled react dev tools and let go!!!

Solution 4:[4]

just disable the React Dev Tools Chrome

Solution 5:[5]

i think you guys using react 18

use useEffect to console the user from useState

useEffect(()=>{

if (user) {console.log(user)} },[])

100% will work,or else let me know i will suggest you one more method

Solution 6:[6]

simple use console.dir(user) instead of console.log(user);

Solution 7:[7]

Disable React Developer Tools and refresh the page.

Solution 8:[8]

it works for me. I face the same problem.

useEffect(()=>{

      if (user) {console.log(user)} },[])

thank's @VAMagendran

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MD ANAM E RASUL CHOWDHURAY
Solution 2 Rahman Hamim
Solution 3 Araz
Solution 4 ImDevFps
Solution 5 V A Magendran
Solution 6 GR NISAN
Solution 7 Umamad
Solution 8 Humaira Mitul