Baseflow / Baseflow/flutter-geolocator
[Bug]: Geolocator.getCurrentPosition() throws an error on Edge browser.
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
### Please check the following before submitting a new issue.
- [x] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [x] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [ ] Android
- [ ] iOS
- [ ] Linux
- [ ] macOS
- [x] Web
- [ ] Windows
### Steps to reproduce
1. Run a flutter web app on Edge browser
2. Call `Geolocator.getCurrentPosition();`
3. Authorize access to location
This works fine on Chrome, but not on Edge.
### Expected results
It should return the position of the device
### Actual results
You get the following error: `Error getting current position: Something went wrong while listening for position updates.`
### Code sample
Code sample
I have created a basic repo that allows to recreate the issue.
https://github.com/rostaingc/location_test_app.git
```dart
final position = await Geolocator.getCurrentPosition();
```
### Version
14.0.1
### Flutter Doctor output
Doctor output
```console
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.5 24F74 darwin-arm64, locale en-SG) [1,657ms]
• Flutter version 3.29.3 on channel stable at /Users/charlesrostaing/Documents/git/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ea121f8859 (2 months ago), 2025-04-11 19:10:07 +0000
• Engine revision cf56914b32
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.0s]
• Android SDK at /Users/charlesrostaing/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• ANDROID_HOME = /Users/charlesrostaing/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [2.0s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16F6
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1) [8ms]
• 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 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.101.0) [7ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.112.0
[✓] Connected device (4 available) [5.9s]
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.5 24F74 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.5 24F74 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 137.0.7151.120
[✓] Network resources [298ms]
• All expected network resources are available.
• No issues found!
```
Contributor guide
Research direction
Start with the provided location_test_app repository and reproduce the failure in an Edge browser using Geolocator.getCurrentPosition(). Compare the Edge behavior with Chrome and trace the web implementation of position updates. Done means the call returns the device position on Edge without the reported listening error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100