ConnectWeb3 error on WebGL using unity-web3-game-kit sample

I’m trying to build and run the sample from this GitHub repository (https://github.com/MoralisWeb3/unity-web3-game-kit) on WebGL, but I get an error saying “undefined connect” when tried to connect a wallet.

[Preconsidion]
I followed this article ([SOLVED] Server page in moralis is missing) to set up my local server environment.
My Unity version is 2021.3.16f1.

[Error]
exception thrown: TypeError: Cannot read properties of undefined (reading ‘connect’),TypeError: Cannot read properties of undefined (reading ‘connect’)
at _ConnectWeb3 (http://127.0.0.1:8887/Build/04.framework.js:3:21210)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[81811]:0x1640f54
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116991]:0x1cc3d49
at invoke_viiii (http://127.0.0.1:8887/Build/04.framework.js:3:404366)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[12015]:0x330143
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[81886]:0x164289b
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116994]:0x1cc3d7d
at invoke_viii (http://127.0.0.1:8887/Build/04.framework.js:3:403837)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[15475]:0x46d67f
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[20610]:0x5cf42e
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[81901]:0x1642dd7
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116999]:0x1cc3dbd
at invoke_vii (http://127.0.0.1:8887/Build/04.framework.js:3:405220)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[17126]:0x4c79fd
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[20617]:0x5cf4a4
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[111445]:0x1bbd155
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116994]:0x1cc3d7d
at invoke_viii (http://127.0.0.1:8887/Build/04.framework.js:3:403837)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[50865]:0xe8e9f0
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116999]:0x1cc3dbd
at invoke_vii (http://127.0.0.1:8887/Build/04.framework.js:3:405220)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[34074]:0x9fd386
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[34073]:0x9fd29a
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[111440]:0x1bbcebe
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[1380]:0xfcf6b
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[18824]:0x57b991
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[38346]:0xb1dfe3
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[45072]:0xce13d1
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[25882]:0x6fd1c5
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[50878]:0xe91f4a
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[111422]:0x1bbc850
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[4812]:0x19afe1
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[21930]:0x61ac81
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[25287]:0x6e7c8c
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[105162]:0x1aacedd
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[613]:0xe2b0a
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[104400]:0x1a8c8e4
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[973]:0xed1e3
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[1232]:0xf63d0
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[116991]:0x1cc3d49
at invoke_viiii (http://127.0.0.1:8887/Build/04.framework.js:3:404366)
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[36815]:0xaa4b72
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[2386]:0x124a56
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[25129]:0x6dfbaf
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[16798]:0x4b159a
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[48203]:0xde249e
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[48207]:0xde2faf
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[104327]:0x1a89d0f
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[104431]:0x1a8d3f6
at http://127.0.0.1:8887/Build/04.wasm:wasm-function[130303]:0x20a56ee

I don’t know why this is happening or how to fix it. Can anyone help me?

Hi @1mono2
Can you show the code where you have connect property? Maybe you can trace it using the error logs

@johnversus
Mabey Here. It’s in web3gl.jslib.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.