flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

[Bug]: Uncaught (in promise) in web

Open mbfakourii opened this issue 1 year ago • 5 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [ ] Android
  • [ ] iOS
  • [ ] Windows

Steps to reproduce

  1. Create an empty Flutter project.
  2. Just add the package permission_handler: ^11.3.1 in pubspec.yaml and in the dependencies section.
  3. Run the project with the command flutter run -d web-server --web-hostname 0.0.0.0 --web-port 5000.
  4. After running, open the address in Chrome with the local IP. (for example 192.168.1.2:5000)

Expected results

The project remains in the first loading and we get the following error in Chrome logs

Uncaught (in promise) null

Actual results

It should run without problems.

Code sample

n/a

Screenshots or video

Screenshots or video demonstration

image

Version

11.3.1

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.22631.4037], locale en-US)
    • Flutter version 3.24.0 on channel stable at C:\Users\mbfakourii\Develop\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (4 weeks ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\mbfakourii\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.9.34728.123
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 17.0.11+0--11852314)

[√] VS Code (version 1.90.2)
    • VS Code at C:\Users\mbfakourii\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.94.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4037]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 127.0.6533.122
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 127.0.2651.98

[√] Network resources
    • All expected network resources are available.

• No issues found!

mbfakourii avatar Aug 24 '24 07:08 mbfakourii

After many checks, I realized that this problem happened after version 10.4.5 and the problem started in version 11.0.0.

Version 10.4.5 has no problem!

mbfakourii avatar Aug 24 '24 11:08 mbfakourii

Dear @mbfakourii,

Thanks for your input. It looks like an issue on windows. I tried to reproduce this on a Mac but so-far no luck. I'll keep it open for now.

Kind regards,

TimHoogstrate avatar Aug 26 '24 10:08 TimHoogstrate

I'm also experiencing the same thing in Windows.

parancode avatar Aug 27 '24 04:08 parancode

I use mac and use plugin version 11.3.1 and flutter version 3.22.2, I added version 11.3.1 to empty project and flutter run -d web-server --web-port 8080 --web-hostname xxx.xxx.xxx.xx If you build using this command, the above error occurs.

Gyeony95 avatar Aug 28 '24 05:08 Gyeony95

After many checks, I realized that this problem happened after version 10.4.5 and the problem started in version 11.0.0.

Version 10.4.5 has no problem!

Thank you, I'm experiencing this issue in Windows too, it prevents the App to load in the browser. Version 10.4.5 worked!

realnikitimi avatar Aug 28 '24 07:08 realnikitimi