我用波动的网页制作了一个网页。 我用命令测试了
webdev serve
我可以看到整个网站,
但是当我想使用以下命令“导出/保存”网站时:
webdev build
该网页为空白,(当我打开构建文件夹中的html文件时)
[INFO] Reading cached asset graph completed, took 245ms
[INFO] Checking for updates since last build completed, took 806ms
[INFO] Running build completed, took 217ms
[INFO] Caching finalized dependency graph completed, took 148ms
[INFO] Reading manifest at build/.build.manifest completed, took 1ms
[INFO] Deleting previous outputs in `build` completed, took 45ms
[INFO] Creating merged output dir `build` completed, took 226ms
[INFO] Writing asset manifest completed, took 4ms
[INFO] Succeeded after 671ms with 0 outputs (0 actions)
谢谢!
更新:
如果我打开构建文件夹中的html文件(该屏幕空白)。这些是我在谷歌浏览器控制台中的错误:
答案 0 :(得分:3)
我的Flutter Web应用程序也显示空白页/空白屏幕...
尝试在终端中运行以下命令:
flutter channel dev
flutter upgrade
flutter run -d chrome
如果仍然显示空白页(由于某种原因未到达本地服务器),请终止当前服务器'ctrl + c'。
然后运行flutter run -d web
,终端将为您提供一个新的本地主机URL。点击链接并刷新一次,您应该会看到您的应用正在运行。
答案 1 :(得分:2)
我有一个相同的问题,但是当我上载实时服务器(主机)时,它可以正常工作。我不确定,但是可能与CORS有关,浏览器不允许某些来源来自网站外部,因此本地文件中具有本地来源,这意味着它们是来自网站外部的浏览器视图。我认为您应该上传实时服务器或本地服务器。