Discussion:
[dart-misc] (1) Don't understand the error; (2) Seeking recommendation for an efficient workflow for Dart
Test This
2016-06-22 14:08:24 UTC
Permalink
Hello

Started with Dart recently and am enjoying working with it. It feel great.

However, I have run into an issue and am looking for advice on a more
efficient
workflow. Currently, I make changes to my dart file, compile it to js using
dart2js and then reload the webpage that references the compiled js file.
Forgetting the long
time it takes to compile, I have the following more serious issue.

When there is an error in my Dart code,
the error message in the Chrome Developer tool is next to useless (maybe, I
don't know how to read it). For example, I made the following mistake. I
defined

*TableRowElement tr; // instead of TableRowElement tr = new
TableRowElement();*

and then tried adding cell elements to tr. After compiling to js (no error
was
thrown during the compilation), on the browser developer window, I got some
some general "uncaught exception" error...nothing pointing to the specific
error I had
made.

I thought that probably I should load the app in Dartium/Chromium and use
the
dart file instead of the compiled js file. I did that, and the developer
window
in Chromium says that I have an 'Uncaught SyntaxError: Unexpected reserved
word'
in line 2 of my code, which is

import 'dart:html';

Can someone help me understand why I am obtaining this error? And, in
general what would
be a good workflow to use with Dart.

Thank you.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Harry Terkelsen' via Dart Misc
2016-06-22 18:33:34 UTC
Permalink
I would recommend using Dartium for your edit/refresh workflow. Then you
should get an error saying something like 'noSuchMethod cells on null' and
it will show you where in your code you are trying to tr, which is null
since it's not initialized to a value.

Your SyntaxError looks to me like you tried to run dart code in Chrome as
js code and it's failing since 'import' is reserved. Make sure you're using
Dartium, not Chrome.
Post by Test This
Hello
Started with Dart recently and am enjoying working with it. It feel great.
However, I have run into an issue and am looking for advice on a more
efficient
workflow. Currently, I make changes to my dart file, compile it to js using
dart2js and then reload the webpage that references the compiled js file.
Forgetting the long
time it takes to compile, I have the following more serious issue.
When there is an error in my Dart code,
the error message in the Chrome Developer tool is next to useless (maybe, I
don't know how to read it). For example, I made the following mistake. I
defined
*TableRowElement tr; // instead of TableRowElement tr = new
TableRowElement();*
and then tried adding cell elements to tr. After compiling to js (no error
was
thrown during the compilation), on the browser developer window, I got some
some general "uncaught exception" error...nothing pointing to the specific
error I had
made.
I thought that probably I should load the app in Dartium/Chromium and use
the
dart file instead of the compiled js file. I did that, and the developer
window
in Chromium says that I have an 'Uncaught SyntaxError: Unexpected reserved
word'
in line 2 of my code, which is
import 'dart:html';
Can someone help me understand why I am obtaining this error? And, in
general what would
be a good workflow to use with Dart.
Thank you.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Jim Trainor
2016-06-23 13:46:17 UTC
Permalink
Your script tag should look like this:

<script type=“application/dart”src="myProgram.dart"></script>


Perhaps you missed the type.


It should work fine in Dartium. Nothing other than the dart script tag is
necessary to get the dart code to execute in Dartium.





On Wed, Jun 22, 2016 at 2:33 PM, 'Harry Terkelsen' via Dart Misc <
Post by 'Harry Terkelsen' via Dart Misc
I would recommend using Dartium for your edit/refresh workflow. Then you
should get an error saying something like 'noSuchMethod cells on null' and
it will show you where in your code you are trying to tr, which is null
since it's not initialized to a value.
Your SyntaxError looks to me like you tried to run dart code in Chrome as
js code and it's failing since 'import' is reserved. Make sure you're using
Dartium, not Chrome.
Post by Test This
Hello
Started with Dart recently and am enjoying working with it. It feel great.
However, I have run into an issue and am looking for advice on a more
efficient
workflow. Currently, I make changes to my dart file, compile it to js using
dart2js and then reload the webpage that references the compiled js file.
Forgetting the long
time it takes to compile, I have the following more serious issue.
When there is an error in my Dart code,
the error message in the Chrome Developer tool is next to useless (maybe, I
don't know how to read it). For example, I made the following mistake. I
defined
*TableRowElement tr; // instead of TableRowElement tr = new
TableRowElement();*
and then tried adding cell elements to tr. After compiling to js (no
error was
thrown during the compilation), on the browser developer window, I got some
some general "uncaught exception" error...nothing pointing to the
specific error I had
made.
I thought that probably I should load the app in Dartium/Chromium and use
the
dart file instead of the compiled js file. I did that, and the developer
window
in Chromium says that I have an 'Uncaught SyntaxError: Unexpected
reserved word'
in line 2 of my code, which is
import 'dart:html';
Can someone help me understand why I am obtaining this error? And, in
general what would
be a good workflow to use with Dart.
Thank you.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Test This
2016-06-23 15:18:57 UTC
Permalink
Thank you Harry and Jim.

Yes, I was missing the type=application/dart in the script tag. Now it
works well in Dartium and the errors are also more informative.

Dart feels so much better compared to JavaScript.
Post by Jim Trainor
<script type=“application/dart”src="myProgram.dart"></script>
Perhaps you missed the type.
It should work fine in Dartium. Nothing other than the dart script tag is
necessary to get the dart code to execute in Dartium.
On Wed, Jun 22, 2016 at 2:33 PM, 'Harry Terkelsen' via Dart Misc <
Post by 'Harry Terkelsen' via Dart Misc
I would recommend using Dartium for your edit/refresh workflow. Then you
should get an error saying something like 'noSuchMethod cells on null' and
it will show you where in your code you are trying to tr, which is null
since it's not initialized to a value.
Your SyntaxError looks to me like you tried to run dart code in Chrome as
js code and it's failing since 'import' is reserved. Make sure you're using
Dartium, not Chrome.
Post by Test This
Hello
Started with Dart recently and am enjoying working with it. It feel great.
However, I have run into an issue and am looking for advice on a more
efficient
workflow. Currently, I make changes to my dart file, compile it to js using
dart2js and then reload the webpage that references the compiled js
file. Forgetting the long
time it takes to compile, I have the following more serious issue.
When there is an error in my Dart code,
the error message in the Chrome Developer tool is next to useless (maybe, I
don't know how to read it). For example, I made the following mistake. I
defined
*TableRowElement tr; // instead of TableRowElement tr = new
TableRowElement();*
and then tried adding cell elements to tr. After compiling to js (no
error was
thrown during the compilation), on the browser developer window, I got some
some general "uncaught exception" error...nothing pointing to the
specific error I had
made.
I thought that probably I should load the app in Dartium/Chromium and
use the
dart file instead of the compiled js file. I did that, and the developer
window
in Chromium says that I have an 'Uncaught SyntaxError: Unexpected
reserved word'
in line 2 of my code, which is
import 'dart:html';
Can someone help me understand why I am obtaining this error? And, in
general what would
be a good workflow to use with Dart.
Thank you.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...