【发布时间】:2021-10-06 16:42:45
【问题描述】:
当我在 Android Studio 中使用运行按钮或flutter run -d Chrome 运行 Flutter Web 应用程序时,一切正常。
当我运行flutter build web 并打开$(project_dir)/build/web/index.html 时,我得到一个白屏。浏览器控制台有这些错误:
Failed to load app from a service worker. Falling back to plain <script> tag. index.html:85:21
Loading failed for the <script> with source “file:///main.dart.js”. index.html:1:1
当我运行flutter build web -v 时,会出现以下内容:
[ +68 ms] Skipping target: web_entrypoint
[ +1 ms] Skipping target: gen_localizations
[ +311 ms] Skipping target: dart2js
[ +10 ms] invalidated build due to missing files:
/home/vanousek/prg/substance-mix/DOES_NOT_EXIST_RERUN_FOR_WILDCARD954977783
[ +72 ms] web_release_bundle: Starting due to {InvalidatedReasonKind.inputMissing: The following inputs were
missing: /home/vanousek/prg/substance-mix/DOES_NOT_EXIST_RERUN_FOR_WILDCARD954977783,
InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
/home/vanousek/prg/substance-mix/build/web/main.dart.js,build/web/index.html}
[ +121 ms] Manifest contained wildcard assets. Inserting missing file into build graph to force rerun. for
more information see #56466.
【问题讨论】:
标签: flutter flutter-web