[英]Problem while running Flutter web project
I started a new Flutter web Project and following all steps of the installation correctly.我开始了一个新的 Flutter web 项目,并正确执行了所有安装步骤。 When I started to Debugging it or running it.当我开始调试或运行它时。 This is the log I am getting while running.这是我在运行时得到的日志。 It opens the chrome window also and nothing is rendering on the screen.它也会打开 chrome 窗口,屏幕上没有任何渲染。 I didn't modify any of pre-generated file like main.dart
and others.我没有修改任何像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)
There are issues with source maps on the latest SDK for Windows.适用于 Windows 的最新 SDK 上的源映射存在问题。 I believe the root cause is this: https://github.com/dart-lang/sdk/issues/37364我相信根本原因是这样的: https : //github.com/dart-lang/sdk/issues/37364
Note there is a pending fix which should resolve your issue.请注意,有一个待定的修复程序可以解决您的问题。
确保你也更新到最新的 build_web_compilers 版本 - 有一个类似的错误已经修复并发布,你可能会遇到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.