Unable to connect on local network

When I try to connect via local network address like http://192.168.1.5:3000 I get these errors.

I already added the URL to the whitelist but I think the issue is inside the plugin.

I really need this to be possible because it makes debugging on smartphones impossible without sending unfinished code to our release server, which I really dislike.

Hey @kewyn.comercial can you share more details to help you with the issue? Can you share the SDK with their version you are using? The initialisation code, and connect code snippet?

Hey @kewyn.comercial,

Just checking in—were you able to resolve this error on your own, or do you still need some assistance?

Still not working. We launched our service so I was very busy.

@web3auth/modal": “7.0.1”,
@web3auth/openlogin-adapter": “^7.0.1”,

  const init = useCallback(async () => {
    try {
      const { Web3Auth } = await import('@web3auth/modal/dist/modal.umd.min');
      const { OpenloginAdapter } = await import('@web3auth/openlogin-adapter/dist/openloginAdapter.umd.min');

      const polygonNetwork = getEVMNetworkById(BLOCKCHAINS.Polygon);
      if (!polygonNetwork) {
        console.error('Failed to get polygon network to start Web3Auth');
        return;
      }

      const web3auth = new Web3Auth({
        clientId: ''
        web3AuthNetwork: !isDev ? 'cyan' : 'testnet', // mainnet, aqua,  cyan or testnet
        chainConfig: {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: `0x${polygonNetwork.chainId.toString(16)}`,
          rpcTarget: polygonNetwork.rpcUrl, // This is the public RPC we have added, please pass on your own endpoint while creating an app
        },
        authMode: 'WALLET',
        uiConfig: {},
      });

      setWeb3Auth(web3auth);

      const openLoginAdapter = new OpenloginAdapter({
        loginSettings: {
          mfaLevel: 'none',
        },
        adapterSettings: {
          uxMode: 'redirect',
        },
      });
      web3auth.configureAdapter(openLoginAdapter);

      await web3auth.initModal();

      if (web3auth.provider) {
        setProvider(web3auth.provider);
      }

      // Here we get all EVM contract currencies
      const evmNativeCurrencies: ICurrency[] = [];
      getEVMNetworks().forEach((network) => {
        const nativeCurrency = getNetworkNativeCurrency(network.id);
        if (nativeCurrency) evmNativeCurrencies.push(nativeCurrency);
      });

      // And here we add all of them to the web3auth plugin
      const promises = evmNativeCurrencies.map(async (currency) => {
        if (!currency.networkId) return;

        const network = getEVMNetworkById(currency.networkId);
        if (!network) return;

        await web3auth.addChain({
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: `0x${network.chainId.toString(16)}`,
          rpcTarget: network.rpcUrl,
          displayName: network.name,
          decimals: currency.decimals,
          blockExplorer: network.explorerUrl,
          ticker: currency.symbol,
          tickerName: currency.name,
        });
      });
      await Promise.all(promises);

      await web3Auth?.switchChain({ chainId: `0x${polygonNetwork.chainId.toString(16)}` });
    } catch (error) {
      console.error('Failed to start Web3Auth', error);
    }
  }, [currencies, networks]);

const connect = useCallback(async (): Promise<SafeEventEmitterProvider | null> => {
    if (!web3Auth) return null;

    const provider = await web3Auth.connect().catch(() => null);

    return provider;
  }, [web3Auth]);

  const logout = async () => {
    if (!web3Auth) return;

    await web3Auth.logout();
  };

Hey @kewyn.comercial,

I apologize for the delay. Could you please plan an upgrade to v8, as we have scheduled a deprecation for all versions below v8? I’ll be here to assist you if this issue persists even after the upgrade.