I recently migrated my game from Bevy 0.8 to Bevy 0.10. This included a custom material that has both the vertex shader and the fragment shader in the same *.wgsl file. It was working fine when running natively on my Mac, until I noticed that it crashes on the Web Browser after WASM build.
I managed to locate the error. It is happening because there's a discard; in the #import bevy_pbr::pbr_functions (the file I'm importing in my shader since I'm using the standard material functions in my shader).
I managed to get it to work by commenting out this discard; in the alpha_discard() fn, and replacing the import with this changed file. It now works on both native + web platforms. Although I'm not sure if this is the right way.
I wanted to report this nevertheless since I'm still very new to shaders. The shaders file is quite long which is why I've excluded it. Let me know if y'all need it.