Dart: “Invalid argument(s): Illegal character in path” when building on Windows

江枫思渺然 提交于 2019-12-22 08:34:26

问题


The offending line in my index.html file reads

<script src="main.dart" type="application/dart"></script>

The error report is:

Build error:
Transform polymer (PolymerBootstrapTransformer) on myproj_frontend|web/index.html threw error: Invalid argument(s): Illegal character in path
dart:core/uri.dart 855                               Uri._checkWindowsPathReservedCharacters
dart:core/uri.dart 956                               Uri._makeWindowsFileUrl

The entire path to the project is

D:\Projects\MyProj\MyProj_Project

I'm building from command line on Windows 7 using Dart VM version: 1.16.0

I honestly have no idea how to continue diagnosing or fixing this. Any help would be greatly appreciated.


回答1:


I have the same problem. Looks like it is an issue with the analyzer package 0.27.0 and later.

I solved it by pinning the version in pubspec.yaml to <0.27.0.




回答2:


I found that analyzer 0.27.2 is ok, but analyzer 0.27.3 will cause exception “Invalid argument(s): Illegal character in path” on my Win 10.

ps. I use Dart 1.16.0



来源:https://stackoverflow.com/questions/36906719/dart-invalid-arguments-illegal-character-in-path-when-building-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!