Why does my audio work fine in the editor but doesn't play in the WebGL build?

I’m making a game in Unity 2018.2.21f1. When I create the WebGL build everything works like it does in the editor except no audio plays. Whenever audio should play I get the error “Decode error” followed by “Uncaught (in promise) DOMException”. Any idea what could cause this?

Updating to Unity 2019.2.0f1 fixed it.