当我为AngularDart应用运行pub -v serve web
时,pub
始终挂在此处:
% pub -v serve web
FINE: Pub 1.25.0-dev.16.4
FINE: Loading asset environment...
FINE: Initializing barback...
FINE: Serving packages on localhost:0.
MSG : Loading source assets...
FINE: Providing sources for ordreset|lib.
FINE: Loading source assets finished (0.053s).
FINE: Provided sources.
FINE: Loading transformers...
FINE: Transformer dependencies:
| angular: -
| test/pub_serve: -
| dart_to_js_script_rewriter: -
FINE: Using cached transformer snapshot.
MSG : Loading angular, test/pub_serve and dart_to_js_script_rewriter transformers...
FINE: Loading transformers from [angular, test/pub_serve, dart_to_js_script_rewriter]
FINE: Spawning isolate from ./.pub/transformers/transformers.snapshot.
FINE: Loading angular, test/pub_serve and dart_to_js_script_rewriter transformers finished (0.151s).
FINE: Transformers from angular: {group of [[BuilderTransformer: Instance of 'TemplatePlaceholderBuilder'], [ReflectionRemover], [StylesheetCompiler, BuilderTransformer: Instance of 'LibraryBuilder']]}
FINE: Transformers from test/pub_serve: {PubServe}
FINE: Transformers from dart_to_js_script_rewriter: {DartToJsScriptRewriter}
FINE: Loading transformers finished (0.649s).
FINE: Initializing barback finished (0.763s).
FINE: Loading asset environment finished (1.062s).
FINE: Providing sources for ordreset|web.
FINE: Bound "web" to localhost:8080.
MSG : Serving ordreset web on http://localhost:8080
FINE: [Fine from StylesheetCompiler]:
| [processStylesheet] took 50 ms on ordreset|lib/src/dashboard_component.css
FINE: [Fine from StylesheetCompiler on ordreset|lib/src/dashboard_component.css]:
| Took 0.2s (0.0s awaiting secondary inputs).
FINE: [Fine from StylesheetCompiler]:
| [processStylesheet] took 30 ms on ordreset|web/main.css
FINE: [Fine from StylesheetCompiler on ordreset|web/main.css]:
| Took 0.2s (0.0s awaiting secondary inputs).
FINE: [Fine from BuilderTransformer: Instance of 'TemplatePlaceholderBuilder' on ordreset|primary]:
| Took 0.4s (0.0s awaiting secondary inputs).
FINE: [Fine from BuilderTransformer: Instance of 'LibraryBuilder' on ordreset|primary]:
| Not yet complete after 10.0s
FINE: [Fine from BuilderTransformer: Instance of 'LibraryBuilder' on ordreset|primary]:
| Not yet complete after 20.0s
我注意到在删除所有import 'package:xml/xml.dart' as xml;
语句时,pub serve
不再挂起。但我确实在过去观察到相同的行为,删除所有import 'package:angular_components/angular_components.dart';
也解决了问题。因此,我实际上怀疑这是xml
或angular_components
包的问题,但问题可能与source_gen
的导入限制有关,类似于this issue过去。
我上传了我的AngularDart项目here。您可以自己运行pub get
然后pub -v serve web
来查看pub
如何挂起。
PS:出于隐私原因,在将代码推送到公共GitHub存储库之前,我已经清空了所有AngularDart HTML模板文件,但这不应该改变pub serve
应该仍然成功的事实。
答案 0 :(得分:1)
https://github.com/thosakwe/pub_mediator(web version is currently down :-/)
reveales
$ mediator
✗ Found 1 dependency conflict:
Found 2 mismatching dependencies on package:build:
* angular requires ^0.10.0
* angular->build_barback requires ^0.11.0
您可以尝试添加
dependency_overrides:
build: ^0.11.0
答案 1 :(得分:0)
正如@GünterZöchbauer在回答评论中指出的那样,按照以下步骤解决问题:
.pub
。pub get --no-precompile
而不是常规pub get
以防止预编译,这似乎会导致问题。pub serve
。