You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flutter doesn't support ConstrainedLanguage PowerShell language mode #172895
Downloaded the Flutter 3.32.7 zip from flutter.dev on Windows 10.
Extracted the zip into c:\src\sdks\flutter.
Added c:\src\sdks\flutter\bin to the PATH.
Run flutter in the command prompt and in PowerShell.
Actual results
Trying to run flutter from a freshly downloaded .zip of Flutter 3.32.7 on Windows 10 fails when the PowerShell language mode is ConstrainedLanguage:
PS C:\src> flutter
New-Object: C:\src\sdks\flutter\bin\internal\update_engine_version.ps1:72
Line |
72 | $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot create type. Only core types are supported in this language mode.
Error: Unable to determine engine version...
Running flutter from the command prompt shows the same error but also immediately closes the command prompt window, making it very hard see what went wrong.
Logs
Logs
PS C:\src> flutterNew-Object: C:\src\sdks\flutter\bin\internal\update_engine_version.ps1:72Line | 72 | $utf8NoBom = New-Object System.Text.UTF8Encoding($false) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot create type. Only core types are supported in this language mode.Error: Unable to determine engine version...
Flutter Doctor output
Doctor output
PS C:\src> flutter doctorNew-Object: C:\src\sdks\flutter\bin\internal\update_engine_version.ps1:72Line | 72 | $utf8NoBom = New-Object System.Text.UTF8Encoding($false) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot create type. Only core types are supported in this language mode.Error: Unable to determine engine version...
Thanks for the report, @johnniwinther. I don't have a Windows setup to verify this at the moment, but I'm keeping the issue open based on your report for the team's tracking and input.
@johnniwinther Could you expand why you need Constrained Language mode? What's your scenario?
At the very least, gWindows runs with Constrained Language mode. I think I might have a fix, just waiting on @johnniwinther to try it out since I can't reproduce on my gWindows setup.
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 -v and a minimal reproduction of the issue.
Activity
johnniwinther commentedon Jul 29, 2025
cc @bkonyi
tirth-patel-nc commentedon Jul 29, 2025
Thanks for the report, @johnniwinther. I don't have a Windows setup to verify this at the moment, but I'm keeping the issue open based on your report for the team's tracking and input.
https://stackoverflow.com/questions/77950700/powershell-stuck-in-constrained-language-mode
https://stackoverflow.com/questions/79641702/flutter-command-fails-due-to-limited-powershell-language-mode
loic-sharma commentedon Jul 29, 2025
@johnniwinther Could you expand why you need Constrained Language mode? What's your scenario?
bkonyi commentedon Jul 29, 2025
At the very least, gWindows runs with Constrained Language mode. I think I might have a fix, just waiting on @johnniwinther to try it out since I can't reproduce on my gWindows setup.
johnniwinther commentedon Jul 30, 2025
@loic-sharma I think Constrained Language is enforced by corp rules. It is a least the default and I don't think I can change it.
[ Tool ] Don't use .NET APIs in update_engine_version.ps1
[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (#172974)
github-actions commentedon Aug 14, 2025
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.[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (flutter#…
[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (flutter#…
[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (flutter#…
[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (flutter#…
[ Tool ] Don't use .NET APIs in `update_engine_version.ps1` (#172974)