'Error "MetaMask - RPC Error: results is not defined" appeared in none changed code

My app was working without errors with Metamask and Smart Chain - Testnet. Nothing was changed but now I receive MetaMask - RPC Error: results is not defined when trying to use the getFilterLogs method.

More precisely, I use TruffleContract, and this method calls when I use a .allEvents.get() method of the instance of the contract. Whole variables are defined.

      // Get the smart contract data
      $.getJSON("../contracts/CryptoLife.json", function (data) {

        // Instance a new truffle contract from the artifact
        App.contracts.CryptoLife = TruffleContract(data);
          
        //Connect provider to interact with the contract
        App.contracts.CryptoLife.setProvider(App.web3Provider);

        // Log the step finish text
        console.log('--- Contract initiated ---');

        // Go to the next step
        return App.initAccount();

      });  

The contract is deployed.

    // Deploy the contract
    App.contracts.CryptoLife.deployed().then(function(instance){

        // Set a contract instance
        App.cryptoLife = instance;

        // Log the step finished text
        console.log('--- Contract deployed ---');

        // Go to the next step
        return App.loadContractData();
    });

And then set the filter and try to get events.

    // Set the filter
    let allEvents = App.cryptoLife.allEvents({fromBlock: _startBlock,   toBlock: _endBlock});

    // Get events
    allEvents.get((_error, _events)=> { /*some code*/});

This code worked two weeks ago and I did nothing with it. Now it returns the error. This code calls a lot of times for different checked values of _startBlock and _endBlock - error all the time now. Can somebody help and say what's happened with this method of Metamask? I can't find anything on the official site.

The whole code of the app is too long (>3000 lines). I'll post it if it is necessary.

Truffle version 5.4.17

MetaMask version 10.4.1



Sources

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

Source: Stack Overflow

Solution Source