Chrome 39 renders a compiled Dart app as blank

一曲冷凌霜 提交于 2019-12-11 06:24:47

问题


I am using Dart 1.8.3, Windows 8.1, Chrome 39.0.2171.95 m

Build a sample Polymer app from File > New Project dialog and chose polymerapp. It works fine in Dartium.

Compile to JS. Works fine in Firefox, but only shows a blank page in Chrome:

Searched here for some relevant topics and still getting nowhere. Would appreciate hints and guidance.


回答1:


I guess this is because you need to start Chrome with --allow-file-access-from-files in order to be able or load local files.

Alternatively try to load the page from pub serve which does Dart2JS compilation on the fly (launch the page from DartEditor and then copy the URL from Dartium to Chrome).

Use any web server Python simplehttpserver or create on in Dart with a few lines of code.




回答2:


I did the following test: deploy the build directory into my web server and it works fine. Thanks for the hint from Zochbauer that leads me to this.

In my view, this problem is more or less solved.



来源:https://stackoverflow.com/questions/27586117/chrome-39-renders-a-compiled-dart-app-as-blank

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!