问题
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