-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
So, this was incredibly painful to track down, but it turns out that if an argument starts with a -(dash) and contains a .(period) than powershell will split it into two arguments. So -Ddart.vm.profile=false is sent to dart as the args "-Ddart" and ".vm.profile=false"
you can test this out with the echo command:
PS C:\Program Files\PowerShell\7> echo -Ddart.vm.profile=false
-Ddart
.vm.profile=false
This breaks argument formatting and will sometimes cause the command
dartaotruntime.exe frontend_server_aot.dart.snapshot [args]
to fall into the options.rest.isNotEmpty case and try to compile ".vm.profile=false" which will cause it to crash with a very confusing message of "unable to rebuild for Windows "type 'Null' is not a subtype of type 'Library' in type cast"
You can read more about it here: https://stackoverflow.com/questions/28704867/why-does-powershell-split-arguments-containing-hyphens-and-periods
Not sure how to fix other than dropping any arguments that use that format, but will try switching my terminal type to command prompt