Dart – running a project does not load the dart file and not printing in the console


I have created a new project in dart and added some code, but when I run (I doesn’t matter if I run the dart file with “Run in Dartium” or if Ctrl + R) the dart file is not showing the button that I’ve create in the main, also in the main() method I’ve added a print() in order to print a message in the console, but nothing is showed.

Also: if I run with “Run as JavaScript” the button is showed normally, here is what I’m doing:

enter image description here

1.-my html code:

<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="stylesheet" href="capitulo9.css">

    <script type="application/dart" src="capitulo9.dart"></script>
    <script src="packages/browser/dart.js"></script>


2.-my dart file (forget the code from above everything is commented) I want to print the the message and create the button:

main() {

  print("I wish to print this in the console");

  var startButton = new Element.html("<button>Start</button>");

3.-I have run it with “Run in Dartium” and with the green icon
4.-That’s what I get, no button
5.-no message printed
6.-also no message printed

How should I suppose to run in dart? thanks


My guess is that your copy of Dartium expired. It only works for 60 days, and then you need to upgrade it.

I recently found that it didn’t even show a message to tell you why it wasn’t working (though I believe it’s supposed to). I raised a bug about this; though there’s been no repsonse so far.

Upgrading to the latest code would’ve given you the latest Dartium and fixed it.

Answered By – Danny Tuppeny

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *