Repository: flutter
Issue: Flutter web apps not working on older versions of Safari and WebKit (pretty important and urgent for us!)
Labels: engine,platform-web,browser: safari-macos,P2,team-web,triaged-web

### Steps to reproduce

I don't know if this fits the bug category, but not of the offered issue categories to choose don't fit better with the problem I'd like to report…

Flutter web crashes on Safari and WKWebKit with `WebAssembly.compileStreaming is undefined`


The problem is that flutter web apps don't work on older versions of Safari and WebKit, which I still need to support. For example, I need to support Safari 14.1.3 on macOS 11.1.17 and flutter application stops working when sending request to www.gstatic.com and trying to load file `canvaskit.wasm` from there.

Web console reports the following errors:

```
[Error] Unhandled Promise Rejection: TypeError: WebAssembly.compileStreaming is not a function. (In 'WebAssembly.compileStreaming(fetch(s))', 'WebAssembly.compileStreaming' is undefined)
	g (flutter_bootstrap.js:4:5026)
	(anonymous function) (flutter_bootstrap.js:4:5585)
	asyncFunctionResume
	(anonymous function) (flutter_bootstrap.js:4:5719)
	I (flutter_bootstrap.js:4:5720)
	(anonymous function) (flutter_bootstrap.js:4:7435)
	asyncFunctionResume
	Global Code (flutter_bootstrap.js:20)
[Error] Unhandled Promise Rejection: null
	(anonymous function) (flutter_bootstrap.js:36)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob
```
We use flutter on web both for our store, available on the web, but also in the WKWebView in one of our applications. Everything works fine in newer versions of Safari and WebKit, but fails on older versions. It used to work on older versions as well, but it stopped working after some flutter update (we regularly update our code with each new flutter release). I don't have  clear track when it happened.

Some of the web app I refer to:

https://store.cocoatech.io
https://deckr.surf

The current situation is that flutter apps on web are useless for anyone using older Mac/macOS and there still are many such people (and many in our user base).

I wonder if there's something we can do about it from our side? Any way we can modify or patch flutter default behaviour? I wonder if we could patch the javascript  `if (wasmstuff exists) {}` (assuming that would solve the problem)?

Thanks a lot for looking into this and for providing any explanation, insight and solution, as it's really very important to us, and it's pretty urgent.

### Expected results

Please see the description of the problem above.

### Actual results

Please see the description of the problem above.

### Code sample

N/A

### Screenshots or Video

N/A


### Logs

N/A

### Flutter Doctor output

```
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.7.1 23H222 darwin-arm64, locale en-US)
    • Flutter version 3.24.4 on channel stable at /Users/milke/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 603104015d (10 days ago), 2024-10-24 08:01:25 -0700
    • Engine revision db49896cf2
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).

[✓] Connected device (3 available)            
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.7.1 23H222 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.7.1 23H222 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 130.0.6723.71

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```