Skip to content

Flutter web not working on iOS web having OS version less than 14.1 #104646

@deepak786

Description

@deepak786

When testing the Flutter web app on iOS safari with OS 13.4 and 13.7, it is not working.
We tested it on OS 15.2 and 15.4, it is working fine.

Sample: https://github.com/deepak786/ios_web_issue
web build: https://deepak786.github.io/ios_web_issue_build

It also works fine on the Desktop browsers and Android web browsers.

I inspected the console using the Safari web inspector, it showed the following error:

[Error] SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list.
	(anonymous function) (flutter.js:23)
[Error] ReferenceError: Can't find variable: _flutter
	(anonymous function) (ios_web_issue_build:80)

The same issue happens with Flutter Gallery website.

When I searched about the above error, it seems that flutter.js is declaring the variables in a way that is not supported by iOS 13.
This feature is added in iOS 14.1.
Ref: https://stackoverflow.com/questions/60026651/safari-unexpected-token-expected-an-opening-before-a-methods-paramet

Video showing the error:
https://drive.google.com/file/d/1nFupkQ2ZqHZnXDaBRuP9CO8GMXdkVCPb/view?usp=sharing

flutter doctor -v
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-x64, locale
    en-US)
    • Flutter version 3.0.0 at /Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (2 weeks ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/appleapple/Library/Android/sdk
    • Platform android-31, build-tools 30.0.2
    • ANDROID_HOME = /Users/appleapple/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] IntelliJ IDEA Community Edition (version 2019.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.66.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (4 available)
    • Deepak’s iPhone (mobile) • 00008101-00117D690A80801E            • ios
      • iOS 15.4.1 19E258
    • iPhone 11 Pro (mobile)   • 56817DBD-D6E9-4308-84F2-65A261C2095C • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
    • macOS (desktop)          • macos                                •
      darwin-x64     • macOS 12.3.1 21E258 darwin-x64
    • Chrome (web)             • chrome                               •
      web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressionbrowser: safari-iosonly manifests in Safari on iOSe: OS-version specificAffects only some versions of the relevant operating systemfound in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions