1

My dart apps using polymer no longer work when run as javascript. I recently updated my dart editor to 1.2.0.release (STABLE) with Dart SDK 1.2.0. When my dart.polymer apps run in the browser (as a result of 'run as javascript' on the index.html file under the web directory, or 'run in browser' from the build\web directory from within the Dart editor) the result is the same: the page loads, but the polymer element is not instantiated. I get the same result with both FireFox and Dartium. Selecting 'run in Dartium' on the index.html file in the web directory in the dart editor works. I'm pretty certain the failure started after my Dart editor update. I see no errors reported. I get this same behavior with my own dart.polymer projects, as well as with the stopwatch tutorial project. Can someone suggest what may be wrong? Thanks.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Can you please try to run `pub build` in the commandline from you package directory and run the result. (I usually do this by `run in Dartium` and then copy the URL to Chrome/Firefox and insert `build/` before `web` in the URL. – Günter Zöchbauer Mar 11 '14 at 14:05
  • I got the same result. I do get 5 warnings from dart2js related to the import of 'dart:mirrors'; here's one of them: [Dart2JS on stopwatch|web/index.html_bootstrap.dart]: packages\observe\src\observable.dart:16:1: Info: Import of 'dart:mirrors'. import 'dart:mirrors'; ^^^^^^^^^^^^^^^^^^^^^^ – user3392998 Mar 11 '14 at 16:10
  • Do you have a `main()` method? If yes can you post the code? see http://stackoverflow.com/questions/20982489. Did you run pub upgrade? I with 1.2 there were some problems. Can you try a dev channel Dart version (1.3 pre)? I don't think the warnings are relevant. I get them all the time (since months). – Günter Zöchbauer Mar 11 '14 at 16:17
  • My polymer.dart apps don't have a main() method. I had not run pub upgrade, but did so per your suggestion; and then I ran pub build, and voila - the problem no longer occurs. I have to get my head around the difference between pub get and pub upgrade, and when the upgrade is needed - but for now, the problem is resolved. Thanks. – user3392998 Mar 11 '14 at 18:30
  • take a look at this SO question http://stackoverflow.com/questions/20719515 – Günter Zöchbauer Mar 11 '14 at 18:55

0 Answers0