I wrote a contract to enable registration of a name. As an example, one of the functions takes in a name as a string, then outputs information on the registration of the name (name, registrant, last time that name was updated, registration ID, and whether or not it's currently registered). I can call the function in the Truffle console just fine, but keep getting an Uncaught TypeError when using the web3 JavaScript API to call the same function and I don't know why.
Here's what it looks like in the Truffle console:
When I try to call this same function in a JavaScript console in Chrome (using React to develop a front-end), I get this error and I'm not sure why:
inpage.js:7928 Uncaught TypeError: Cannot read property 'match' of undefined
Here's an image showing the function I'm calling with the error:
The nameRegContract object was created like this for reference:
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var nameRegABI = [... ABI ...];
var nameRegAddress = '0x23fa6b40bdf47a6a41feb62077dab84213daa624';
var nameRegContract = web3.eth.contract(nameRegABI).at(nameRegAddress);
Wondering if anyone knows why I'm getting this error/if I'm using the web3 JavaScript API incorrectly?