Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How can I resolve this error? TypeError: Module.asm.$a is undefined

Discussion in 'Web' started by pbnggames, Aug 22, 2023.

  1. pbnggames

    pbnggames

    Joined:
    Oct 14, 2019
    Posts:
    3
    ***SOLVED***
    The webGL app I have deployed is not working and I can not figure out what is wrong. I updated the editor, I changed some settings according to a few videos I found but they were aimed at deployment on itch.io. This is really frustrating me. I have deployed a webGL app in the past and did not have any issues. Any help would be greatly appreciated.

    This is the error code thrown by Firefox:

    Code (JavaScript):
    1. TypeError: Module.asm.$a is undefined
    2. unityFramework/Module.dynCall_viiiii@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:324120
    3. invoke_viiiii@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:380304
    4. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[2589]:0x11b1c7
    5. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[2589]:0x11aedc
    6. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[26630]:0x1085431
    7. invoke_iii@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:376825
    8. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[1139]:0x80fba
    9. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[26628]:0x108541b
    10. invoke_vi@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:377940
    11. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[54318]:0x16d56aa
    12. @blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7 line 10 > WebAssembly.instantiate:wasm-function[54316]:0x16ca949
    13. unityFramework/Module._main@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:320746
    14. callMain@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:390526
    15. doRun@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:390968
    16. run@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:391132
    17. runCaller@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:390172
    18. removeRunDependency@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:15466
    19. unityFramework/</unityFileSystemInit</<@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:1913
    20. doCallback@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:116718
    21. done@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:116882
    22. unityFramework/reconcile/transaction.oncomplete@blob:https://pbnggames.com/ff6fb507-3f9d-4d0d-889e-fb82539d35e7:10:110532
    I can't find a way to copy and paste the error message thrown by Chrome. You can come to see the app yourself at
    https://pbnggames.com/friendZap/index.html
     
    Last edited: Aug 25, 2023
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,422
    I assume Build&Run locally works fine?
    Try deploying to Unity Play via the WebGL Publisher asset from the store. Or to itch.io. If that works, at least you know it‘s an issue with the webserver.
    Play with the build settings like compression. Be sure to deploy a debug build for testing.
     
    unityruba and pbnggames like this.
  3. pbnggames

    pbnggames

    Joined:
    Oct 14, 2019
    Posts:
    3
    Thank you for pointing me in the correct direction. The issue was that the server was not configured for web assembly files (/wasm) and this was resolved by adding a htaccess file to the game directory as described in the Unity manual here.
     
    unityruba likes this.