3

我开始了一个新的 Flutter web 项目,并正确执行了安装的所有步骤。当我开始调试或运行它时。这是我在运行时得到的日志。它也打开了 chrome 窗口,屏幕上没有呈现任何内容。我没有修改任何预先生成的文件,例如main.dart和其他文件。

[INFO] Connecting to the build daemon...
[INFO] Generating build script...
[INFO] Generating build script completed, took 527ms
[INFO]
[INFO] Starting daemon...
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 490ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.5s
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 490ms
[INFO]
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.5s
[INFO]
[INFO] Setting up file watchers...
[INFO] Setting up file watchers completed, took 5ms
[INFO] Registering build targets...
[INFO] Starting initial build...
[INFO] Serving DevTools at http://127.0.0.1:57020
[INFO] Starting resource servers...
[INFO] Serving `web` on http://127.0.0.1:57011
[INFO] About to build [web]...
[INFO] Running build...
[INFO] 1.0s elapsed, 0/0 actions completed.
[INFO] Running build completed, took 1.2s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 474ms
[INFO] Succeeded after 1.7s with 0 outputs (0 actions)
[INFO] ------------------------------------------------------------------------
Unhandled exception:
FormatException: Unexpected character (at character 1)
Not Found
^
#0      _ChunkedJsonParser.fail  (dart:convert-patch/convert_patch.dart:1392:5)
#1      _ChunkedJsonParser.parseNumber  (dart:convert-patch/convert_patch.dart:1259:9)
#2      _ChunkedJsonParser.parse  (dart:convert-patch/convert_patch.dart:924:22)
#3      _parseJson  (dart:convert-patch/convert_patch.dart:29:10)
#4      JsonDecoder.convert  (dart:convert/json.dart:493:36)
#5      JsonCodec.decode  (dart:convert/json.dart:151:41)
#6      jsonDecode  (dart:convert/json.dart:94:10)
#7      parse 
package:source_maps/parser.dart:27
#8      Sources.scriptParsed  (package:dwds/src/sources.dart:55:19)
<asynchronous suspension>
#9      _RootZone.runUnaryGuarded  (dart:async/zone.dart:1314:10)
#10     CastStreamSubscription._onData  (dart:_internal/async_cast.dart:81:11)
#11     _RootZone.runUnaryGuarded  (dart:async/zone.dart:1314:10)
#12     _BufferingStreamSubscription._sendData  (dart:async/stream_impl.dart:336:11)
#13     _BufferingStreamSubscription._add  (dart:async/stream_impl.dart:263:7)
#14     _SinkTransformerStreamSubscription._add  (dart:async/stream_transformers.dart:68:11)
#15     _EventSinkWrapper.add  (dart:async/stream_transformers.dart:15:11)
#16     WipDomain.eventStream.<anonymous closure>.<anonymous closure>  (package:webkit_inspection_protocol/webkit_inspection_protocol.dart:301:26)
#17     _HandlerEventSink.add  (dart:async/stream_transformers.dart:228:7)
#18     _SinkTransformerStreamSubscription._handleData  (dart:async/stream_transformers.dart:120:24)
#19     _RootZone.runUnaryGuarded  (dart:async/zone.dart:1314:10)
#20     _BufferingStreamSubscription._sendData  (dart:async/stream_impl.dart:336:11)
#21     _DelayedData.perform  (dart:async/stream_impl.dart:591:14)
#22     _StreamImplEvents.handleNext  (dart:async/stream_impl.dart:707:11)
#23     _PendingEvents.schedule.<anonymous closure>  (dart:async/stream_impl.dart:667:7)
#24     _microtaskLoop  (dart:async/schedule_microtask.dart:41:21)
#25     _startMicrotaskLoop  (dart:async/schedule_microtask.dart:50:5)
#26     _runPendingImmediateCallback  (dart:isolate-patch/isolate_patch.dart:116:13)
#27     _RawReceivePortImpl._handleMessage  (dart:isolate-patch/isolate_patch.dart:173:5)
4

2 回答 2

1

最新的适用于 Windows 的 SDK 上的源映射存在问题。我相信根本原因是这样的:https ://github.com/dart-lang/sdk/issues/37364

请注意,有一个待定的修复程序应该可以解决您的问题。

于 2019-07-10T22:39:30.037 回答
0

确保您也更新到最新的 build_web_compilers 版本 - 有一个类似的错误已经修复并发布,您可能会遇到。

于 2019-07-10T23:06:02.440 回答