flutter_soloud icon indicating copy to clipboard operation
flutter_soloud copied to clipboard

fix: [web] NoSuchMethodError _isInited on iOS safari <16.4

Open bshishov opened this issue 5 months ago • 2 comments

Hi,

first of all, thanks for the package!

Description

On relatively old non-updated iPhone 11 (which I happen to have) soloud (3.2.4) fails to initialize on web in Safari prior to 16.4. Tested on iOS Safari 16.3.

SoLoud.instance.init fails with the following error:

NoSuchMethodError: method not found: '_isInited' (t2.Module_soloud._isInited is not a function. (In
12.Module_soloud._isInited), t2.Module_soloud._isInited' is undefined))

Steps To Reproduce

  1. build the following code to the web target
void main() async {
  try {
    await SoLoud.instance.init();
  } catch (e) {
    return runApp(MaterialApp(home: Scaffold(body: Text(e.toString()))));
  }
  return runApp(MaterialApp(home: Scaffold(body: Text("ok"))));
}
  1. serve the build/web and open in Safari on iOS
  2. init fails with NoSuchMethodError

Expected Behavior

SoLoud initializes, or a least provides a more descriptive error.

Additional Context

I've done some research and found that the problem occurs because safari on iOS does not support wasm SIMD before 16.4 (https://caniuse.com/wasm-simd). I've tried to recompile wasm module without -msimd128 -msse3 flags (with opus) and soloud initialized successfully (slowly, however). Not sure if this is a bug or the behavior should be just mentioned somewhere for someone who want to support older browsers on web.

bshishov avatar Aug 05 '25 17:08 bshishov

I had the same problem with "flutter run -d chrome"

yeyuchen198 avatar Aug 20 '25 07:08 yeyuchen198

I am still trying to manage this issue, but @yeyuchen198, can you please check if you configured the web environment? Here the ref: https://docs.page/alnitak/flutter_soloud_docs/get_started/web_notes

alnitak avatar Aug 20 '25 12:08 alnitak