Skip to content

Flutter doesn't support ConstrainedLanguage PowerShell language mode #172895

Closed

Description

@johnniwinther

Steps to reproduce

  1. Downloaded the Flutter 3.32.7 zip from flutter.dev on Windows 10.
  2. Extracted the zip into c:\src\sdks\flutter.
  3. Added c:\src\sdks\flutter\bin to the PATH.
  4. 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> 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...

Flutter Doctor output

Doctor output
PS C:\src> flutter doctor
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...

Activity

  1. johnniwinther commented on Jul 29, 2025

    @johnniwinther
    ContributorAuthor
  2. tirth-patel-nc commented on Jul 29, 2025

    @tirth-patel-nc
    Member

    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

  3. added
    platform-windowsBuilding on or for Windows specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 29, 2025
  4. loic-sharma commented on Jul 29, 2025

    @loic-sharma
    Member

    @johnniwinther Could you expand why you need Constrained Language mode? What's your scenario?

  5. bkonyi commented on Jul 29, 2025

    @bkonyi
    Contributor

    @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.

  6. johnniwinther commented on Jul 30, 2025

    @johnniwinther
    ContributorAuthor

    @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.

  7. github-actions commented on Aug 14, 2025

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions