# Various runtime errors after switching to WebGL

**URL:** <https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907>\
**Category:** Unity\
**Tags:** html5, unity\
**Created:** [July 21, 2024, 7:16am UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907 "2024-07-21T07:16:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdb687](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@abdb687](https://qa.fmod.com/u/abdb687)\
**Post date:** [July 21, 2024, 7:16am UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907/1 "2024-07-21T07:16:58Z")

</div>

I have inherited a project which uses FMOD. I’m a complete noob when it comes to FMOD so am struggling to resolve some errors in my WebGL build.

The game runs great in the editor, with all sound being as intended. It also works in a Windows build.

I switched platform to WebGL and am now receiving a range of errors.

All of these errors disappear (and the game runs fine in WebGL) if I simply uninstall FMOD.

Of course I don’t want to do that, so I’ve installed FMOD and am working to debug these errors.

Currently on startup, in the game’s main menu, I see the following errors. The game doesn’t crash, but all menu functionality is gone. The music plays anyway.

> [FMOD] assert : assertion: ‘mRiffChunk.mType == ChunkType\_Riff && mRiffChunk.mID == id’ failed
> 
> BankLoadException: [FMOD] Could not load bank ‘[http://localhost:57671/StreamingAsset/music.strings.bank](http://localhost:57671/StreamingAsset/music.strings.bank)’ : ERR\_FORMAT ; Unsupported file or audio format.

There’s a repeat of the above error, but with sfx.bank. There are then several errors of the type

> ArgumentNullException. Value cannot be null.  
> Parameter name: source

These null exception errors I believe to be due to the dependency injection system (zenject) trying to refer to something in FMOD which has become null in this build.

All of these problems go away if I simply remove the FMOD folder and references to FMOD in my scripts.

The banks are definitely where the FMOD Settings is looking.

---

<div class="post-metadata">

**Author:** ![abdb687](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@abdb687](https://qa.fmod.com/u/abdb687)\
**Post date:** [July 21, 2024, 2:19pm UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907/2 "2024-07-21T14:19:37Z")

</div>

Some of these errors I resolved by rolling back my version of FMOD in Unity to the version which was used at the time the banks were created.

However, I now have this error:

> BusNotFoundException: [FMOD] Bus not found ‘bus/’

These errors also persist:

> ArgumentNullException. Value cannot be null.  
> Parameter name: source

I can’t seem to designate a bus.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 25, 2024, 12:03am UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907/3 "2024-07-25T00:03:42Z")

</div>

Hi,

It’s likely that your banks aren’t being copied to the build directory properly, potentially due to Zenject, or that your webserver isn’t serving them properly for the build to access. To start I’d recommend checking your WebGL build to ensure that they’re present in the ./StreamingAssets folder and are the correct size, and that your webserver is serving them appropriately.

Otherwise, can I you to provide:

- Your exact Unity and FMOD for Unity version numbers
- A full log from your WebGL build where the issue occurs, with your [logging level set to “Log”](https://www.fmod.com/docs/2.02/unity/settings.html#logging-level) and [API error logging enabled](https://www.fmod.com/docs/2.02/unity/settings.html#enable-api-error-logging)

---

<div class="post-metadata">

**Author:** ![abdb687](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@abdb687](https://qa.fmod.com/u/abdb687)\
**Post date:** [July 25, 2024, 12:11pm UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907/4 "2024-07-25T12:11:05Z")

</div>

I was able to resolve these errors by creating a loading screen before the main menu which checked that all banks have been loaded before proceeding to the main menu.

The main menu’s asynchronous loading (WebGL) was trying to use the banks and bus before they were loaded.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 26, 2024, 12:28am UTC](https://qa.fmod.com/t/various-runtime-errors-after-switching-to-webgl/21907/5 "2024-07-26T00:28:30Z")

</div>

Happy to hear that you resolved the issue!
