Dart 类型';LazyTrace';未加载
从Dart编辑器设置新安装的Dart Polymer项目时,出现以下错误:Dart 类型';LazyTrace';未加载,dart,dart-polymer,Dart,Dart Polymer,从Dart编辑器设置新安装的Dart Polymer项目时,出现以下错误: --- 5:47:24 PM Starting pub serve : testing --- Loading source assets... Loading polymer transformers... Serving testing web on http://localhost:8080 in ShutdownIsolate: Unhandled exception: Uncaught Error: 'pack
--- 5:47:24 PM Starting pub serve : testing ---
Loading source assets...
Loading polymer transformers...
Serving testing web on http://localhost:8080
in ShutdownIsolate: Unhandled exception:
Uncaught Error: 'package:stack_trace/src/trace.dart': malformed type: line 107 pos 16: type 'LazyTrace' is not loaded
return new LazyTrace(() => new Trace.parse(trace.toString()));
^
type error.
Stack Trace:
#0 Trace.Trace.from (package:stack_trace/src/trace.dart:107:16)
#1 Chain.Chain.forTrace (package:stack_trace/src/chain.dart:121:53)
#2 CrossIsolateException.serialize (package:$pub/serialize/exception.dart:46:43)
#3 serializeException (package:$pub/serialize/exception.dart:88:43)
#4 respond.<anonymous closure> (package:$pub/serialize.dart:164:34)
#5 _RootZone.runBinary (dart:async/zone.dart:1156)
#6 _Future._propagateToListeners.handleError (dart:async/future_impl.dart:524)
#7 _Future._propagateToListeners (dart:async/future_impl.dart:582)
#8 _Future._propagateToListeners.handleWhenCompleteCallback.<anonymous closure> (dart:async/future_impl.dart:563)
#9 _RootZone.runUnary (dart:async/zone.dart:1151)
#10 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#11 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#12 _Future._completeWithValue (dart:async/future_impl.dart:339)
#13 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:401)
#14 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#15 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#16 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:883)
#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
公开发行
name: testing
description: A sample Polymer application
dependencies:
polymer: ">=0.12.0 <0.13.0"
transformers:
- polymer:
entry_points: web/testing.html
现在我看不到stack_trace包中定义的LazyTrace类。是否有人对此问题有经验?请尝试从包含
pubspec.yaml
文件的目录运行命令行上的pub cache repair
和pub get
。感谢您的回答。这似乎是一个可能的解决方案,但问题仍然存在。请将您的pubspec.yaml
、pubspec.lock
和dart--version
的输出添加到您的问题中。如果将版本设置为any
,您可能会得到过时的版本。当您运行pub-upgrade
时,输出将显示新版本的可用位置。如果您想要更新的版本,您必须向依赖项添加更具体的版本约束,如polymer:'>=0.15.1+5'
。谢谢居里。我现在把它整理好了。
name: testing
description: A sample Polymer application
dependencies:
polymer: ">=0.12.0 <0.13.0"
transformers:
- polymer:
entry_points: web/testing.html
➜ testing dart --version
Dart VM version: 1.7.2 (Tue Oct 14 06:58:25 2014) on "macos_x64"