Error: Provider does not have a request or send method to use

Error: Provider does not have a request or send method to use.

Getting the error for provider with web3auth when do transaction first time it works fine but after refresh it throughs above error .
below is my code
let web3 = new Web3(provider);
web3.eth.getAccounts().then(async (acc) => {
setLoaderFor(“Buy”);
dispatch(stakeTransactionCredential({ txInProgress: true }));
let balance = await web3.eth.getBalance(acc[0]);

    if (parseFloat(balance) < parseFloat(totalPrice.toString())) {
      setLoaderFor("");
      dispatch(stakeTransactionCredential({ txInProgress: false }));
      ToastShow(t(`MS_LOW_BALANCE`), "error");
      return;
    }

}

Below is my packgae json also web3 verison 1.8

Hi Aman! I see you’re encountering an issue with the error message “Provider does not have a request or send method to use.” Let’s gather a bit more information to help solve this:

  1. SDK Version Number: Which version of the Web3Auth SDK are you using?
  2. Platform: What platform are you integrating Web3Auth with? (e.g., Web, iOS, Android)
  3. Code Snippets: Could you share the initialization and login code snippets you’re using?
  4. Console Screenshots: If you have any, sharing a screenshot of your browser console when the error occurs could be very helpful.

Feel free to upload any relevant images or more details, and we’ll help you sort this out!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

  1. SDK Version Number: “@web3auth/web3auth”: “^2.1.3”, “@web3auth/modal”: “^9.5.1”,
    @web3auth/no-modal”: “8.6.2”,
  2. Platform: What platform are you integrating Web3Auth with WEB
  3. Code Snippets:
  4. Console Screenshots: If you have any, sharing a screenshot of your browser console when the error occurs could be very helpful.

    Uploading: Screenshot from 2025-01-11 18-03-17.png…
    Uploading: Screenshot from 2025-01-11 18-03-02.png…
    Uploading: Screenshot from 2025-01-11 18-02-58.png…