Debugging Dart application sometimes not working?

Hi,

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.

Index.html:

<html>
<head>
    <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">
</head>
<body>
<h1>Pirate badge</h1>


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


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

main.dart:

import 'dart:html';


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


void updateBadge(Event e )
{
  querySelector( '#badgeName' ).text = (e.target 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?

regards,

Wim
PS: I am using IntelliJ 13.1.4

2 comments
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.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.