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

If you facing “Uncaught TypeError: inputArgs[0].match is not a function” error then you are not alone.

Lot of people facing same error “Uncaught TypeError: inputArgs[0].match is not a function” on internet.

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

Above is the attached screenshot of the error.

In this article, we will explain how to fix “Uncaught TypeError- inputArgs[0].match is not a function” error.

What is “Uncaught TypeError- inputArgs[0].match is not a function” Error?

“Uncaught TypeError- inputArgs[0].match is not a function” error occurring to people at difference places.

Shamin Reza asked same query on stackoverflow with code snippet as below:

import { useEffect, useState } from "react";
import "./App.css";

const gridStyle = {
    display: "grid",
    gridTemplateColumns: "repeat(4, 1fr)",
    gridGap: "20px",
};

function App() {
    return (
        <div className="App">
            <Countries></Countries> 
        </div>
    );
}

function Countries() {
    const [countries, setCountries] = useState([]);
    useEffect(() => {
        fetch("https://restcountries.com/v3.1/all")
            .then((res) => res.json())
            .then((data) => setCountries(data));
    }, []);

    return (
        <div className="all-countries">
            <p>{countries.length}</p>
            <div style={gridStyle} className="country-container">
                {countries.map((country) => (
                    <Country country={country}></Country>
                ))}
            </div>
        </div>
    );
}

function Country({ country }) {
    console.log(country);
    return (
        <div className="country">
            <img src={country.flags.png} alt="" />
            <h1>{country.name.common}</h1>
            <p>{country.name.official}</p>
            <p>{country.region}</p>
            <p>{country.population}</p>
            <button>Details</button>
        </div>
    );
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

Shahidul Islam also got with same error “Uncaught TypeError- inputArgs[0].match is not a function”.

He is using react-firebase-auth hook. when he try to loging it login successfully but got same error. Shahidul Islam code as mentioned below:

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

So, Shahidul Islam and Shamin Reza both got same error but at different places.

Why “Uncaught TypeError- inputArgs[0].match is not a function” Error Occurred?

I think “Uncaught TypeError- inputArgs[0].match is not a function” error occurred because of recent commit in the React Dev Tools Chrome Extension.

You can check also:

https://github.com/facebook/react/commit/852f10b5cf188f8aa797f9a809f0caeaa95a4231

But there can be other reason also.

How to Fix “Uncaught TypeError- inputArgs[0].match is not a function” Error?

To fix “Uncaught TypeError- inputArgs[0].match is not a function” error, you should disable React Dev Tool Extension in google chrome or user different browser like Mozila / Safari / Brave. This will fix “Uncaught TypeError- inputArgs[0].match is not a function” error.

Fix 1: Disable React Dev Tool Extension

To fix “Uncaught TypeError- inputArgs[0].match is not a function” error, Disable React Dev Tool Extension in the Google chrome. This will Fix the issue.

Most probably this will resolve your issue. If by disabling React Dev Tool Extension in the Google chrome, still getting same error then try below fixes.

Fix 2: Use Browser Other Than Google Chrome

Alternative to Disabling React Dev Tool Extension in the Google chrome, you can try out different browser also other than chrome like Mozila / Safari / Brave.

Because “Uncaught TypeError- inputArgs[0].match is not a function” error occurred in chrome because of React Dev Tool Extension.

So, if you use any browser other than Google Chrome, you will get this issue.

Fix 3: Pass string as first argument as Console.log(‘ ‘, data)

As Shamin Reza got same error with above mentioned codebase, for that first try fix 1 and fix 2 above mentioned. if you don’t able to resolve error then apply below fix:

you can pass string as first argument as Console.log(' ', data)

By passing string as a first argument will resolve the issue.

Fix 4: Use console.dir() Instead of console.log()

As Shahidul Islam got same error with above mentioned codebase, for that first try fix 1 and fix 2 above mentioned. if you don’t able to resolve error then apply below fix:

you can use console.dir() instead of console.log().

Conclusion

Now, we have explained all possible fixes includes general fixes by disabling React Dev Tool Extension in the Google chrome or use different browser and codebase related fixes.

I am hoping you will able to resolve “Uncaught TypeError- inputArgs[0].match is not a function” by following above fixes.

On Network Cult, Check out other error fixes also, hope you will save lot of time by implementing fixes instantly.