My understanding is that Unity relies on multi-threading many of its tasks (like getting spectrum data) in order to accomplish these things in real time. Unfortunately, webgl doesn't allow for any multi-threading, so builds that rely on it just kind of don't work properly. As it stands, I couldn't find a way to have unity not try to multi-thread processes like 'get_spectrum_data', so doing the calculations before building seemed to be the best solution at the time.
I hope this helped at all!