Repository navigation
[url_launcher] Provide better error message for SE_ERR_NOASSOC (code 31) #138142
Description
Activity
- changed the title
[-][url_launcher] Windows 10 url_launcher package launch error[/-][+][url_launcher] Provide better error message for `SE_ERR_NOASSOC` (code 31)[/+]on Nov 9, 2023 - addedplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyp: url_launcherPlugin to launch external applicationsPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.a: desktopRunning on desktopRunning on desktop
on Nov 9, 2023 Error code 31 is
SE_ERR_NOASSOC, meaning there's no handler registered for that URL.To make this less confusing, and be more consistent with most of the other platforms, we should special case this error code to return
falseinstead of throwing.@stuartmorgan this URL should be handled by the default browser cause it's a regular web app link, this issue only happens on windows 10 and on every other platform and windows 11 it's working perfectly fine. Do you know what can be the cause of this?
We don't have any more information that what is in the error message: the plugin requested (via
ShellExecute) that the OS open the URL you provided, and got an error in response saying there is no associated handler. Perhaps your default browser has not correctly registered itself as the handler for web URLs, or perhaps there's an issue with the URL itself (you haven't provided the string you are using, so we have less information here than you do).@stuartmorgan URL that we try to launch looks something like this
https://appdomain.com/oauth/authorize?client_id=app&response_type=code&code_challenge=pvMiMthjGCumrvqcgCJRd2u_sMedCIqbrf0h0BgcnIU&code_challenge_method=s256. I can't reproduce the error myself on windows 10 but I see that couple of users encounter this problem in the Sentry logs and all the users are using windows 10. Maybe you see something in the URL that can be a problem?- added a commit that references this issue
on Dec 13, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Dec 27, 2023 - addedteam-windowsOwned by the Windows platform teamOwned by the Windows platform teamand removed
on Jun 6, 2024 - added a commit that references this issue
on Jun 10, 2026 - added a commit that references this issue
on Jun 19, 2026
Is there an existing issue for this?
What package does this bug report belong to?
url_launcher
What target platforms are you seeing this bug on?
Windows
Have you already upgraded your packages?
Yes
Dependency versions
pubspec.lock
Steps to reproduce
Uri.parse('URL'),
mode: LaunchMode.externalNonBrowserApplication,
),
Expected results
Launching the url
Actual results
PlatformException: PlatformException(open_error, Failed to open "URL HERE" ShellExecute error code 31, null, null)
Code sample
Code sample
[Paste your code here]launchUrl(
Uri.parse('URL'),
),
Screenshots or Videos
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]