'I get syntax error while setting the state

I am trying to set the initial state in Next.js like this:

constructor(props: Props) {
    super(props);
    const emptyContract = new ethers.Contract(
      "",
      "",
      new ethers.providers.JsonRpcProvider("")
    );
    this.state = {
      account: "0x0",
      blockchainDataLoaded: false,
      futNFT: emptyContract,
      futNFTMatch: emptyContract,
      futNFTTraining: emptyContract,
      futNFTTransfer: emptyContract,
      vrfConsumer: emptyContract,
    };
  }

But I get this error: SyntaxError: Unexpected end of JSON input



Solution 1:[1]

the second parameter of the Contract constructor is an array so replace:

const emptyContract = new ethers.Contract(
  "",
  "",
  new ethers.providers.JsonRpcProvider("")
);

with:

const emptyContract = new ethers.Contract(
  "",
  [],
  new ethers.providers.JsonRpcProvider("")
);

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 free bug coding