The parameter for the JSON.parse may be returning nothing (i.e. the value given for the JSON.parse is undefined
)!
It happened to me while I was parsing the Compiled solidity code from an xyz.sol file.
import web3 from './web3';
import xyz from './build/xyz.json';
const i = new web3.eth.Contract(
JSON.parse(xyz.interface),
'0x99Fd6eFd4257645a34093E657f69150FEFf7CdF5'
);
export default i;
which was misspelled as
JSON.parse(xyz.intereface)
which was returning nothing!