Skip to content

Flutter doesn't support ConstrainedLanguage PowerShell language mode #172895

@johnniwinther

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

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