Debugging Dart application sometimes not working?


I am very new to Dart, so I am unsure if I am doing something wrong or not, but the debugging of a Dart application does not always seem to work.

I am trying to follow along with the "Alvast, Ye Pirates" tutorial.

I have my index.html and my main.dart files.


    <meta charset="utf-8">
    <title>Pirate badge</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="piratebadge.css">
<h1>Pirate badge</h1>

<div >
        <input type="text" id="inputName" maxlength="15">
<div >
    <div >
        Arrr! Me name is
    <div >
        <span id="badgeName"> </span>

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


import 'dart:html';

main( )
  querySelector( '#inputName' ).onInput.listen( updateBadge );

void updateBadge(Event e )
  querySelector( '#badgeName' ).text = ( as InputElement).value;

When I click on the 'Dartium' icon that shows on the right side if I view the index.html file, the application works. If I type something in the input, the badgeName gets updated.

However, when I try to debug, it does not.

For debugging, I run 'pub serve --port=8082' from the terminal window in IntelliJ and I have created a Javascript Debug configuration with the URL 'http://localhost:8082/' and set Dartium as the browser. If I start this run configuration, the browser opens at the good URL, but the application does not work. If I type in the input field nothing happens. If I set a breakpoint, it is not hit.

Any idea what might be wrong?


PS: I am using IntelliJ 13.1.4

Comment actions Permalink

Can you please try IntelliJ IDEA 14 EAP + corresponding Dart plugin or WebStorm 9 EAP?
In these new versions you do not have to start Pub Serve manually and to change URL in the run configuration. Pub Serve is now started automatically and IDE internal web server simply behaves as a proxy between browser and Pub Serve. So all should work with a single right click on HTML and selecting Debug.

Comment actions Permalink

Thanks. The IntelliJ 14 EAP seems to work better indeed!


Please sign in to leave a comment.