Questions tagged [dart2js]

The Dart to JavaScript compiler that reads a Dart file and translates it to JavaScript.

The Dart to JavaScript compiler that reads a Draft file and translates it to JavaScript. It generates JavaScript source code from the Draft files. The name of the tool used to compile the code is draft2js. Dart Editor uses dart2js behind the scenes whenever Dart Editor compiles to JavaScript. It produces a file that contains the JavaScript equivalent of the Dart code. It also produces a source map, which can help to debug the JavaScript version of the app more easily.

196 questions
1
vote
0 answers

Getter/setter "is used reflectively but not in MirrorsUsed" warning after dart2js compilation

In my class, I have getters and setters which are working thanks to NoSuchMethod - that is, they're not explicitly defined. After I compile and run the js, I get the following error in the browser console: Warning: 'closes_in=' is used reflectively…
orion3
  • 9,797
  • 14
  • 67
  • 93
1
vote
1 answer

How do i keep dart names (variables, constants, objects ) using dart2js commands?

I'm trying to compile a dart project by using the command pub build However, this will generate random identifiers for all objects, which will ruin all logging information when it prints the object name. For example, "Object = K1" is printed…
1
vote
1 answer

Getting Error When Adding: commandLineOptions: [--enable-experimental-mirrors]

I got a warning after adding http: to my pub spec.yaml. I did a search on it and this post said to add this to my pubspec: - $dart2js: commandLineOptions: [--enable-experimental-mirrors] I did and got the error: Error on line 12, column 3 of…
curt
  • 4,422
  • 3
  • 42
  • 61
1
vote
3 answers

unclear error from dart2js checked mode

My original error was An attempt was made to use an object that is not, or is no longer, usable. After dart2js runs with the default settings it's pretty difficult to read and I was having trouble debugging the output, so I added these options to my…
Hector
  • 659
  • 1
  • 11
  • 25
1
vote
1 answer

How to use a dartscript on your website

Hello i just started to learn some dart and im new in this forum aswell, i've created the ubersimple webapp, with webstorm and written a really simple dart script and a html document. the head of my html doc:
RedStriped
  • 13
  • 2
1
vote
1 answer

Select() method returns a warning

I need a Select All button for a textarea. It works with this code, but I get a warning from Dart2js: querySelector('#select-all-button').onClick.listen((e) { //e.preventDefault(); querySelector('#textarea-target').select(); }); Warning: No method…
1
vote
1 answer

dart2js: J.getInterceptor$x(...).get$document is not a function

Everything in Dartium works fine, when I'm compiling and executing that class as a JavaScript in Chrome I get: Uncaught TypeError: J.getInterceptor$x(...).get$document is not a function J.get$document$x @ …
artolini
  • 97
  • 1
  • 10
1
vote
1 answer

Using dart2js output with Cloud Code by Parse.com

First, I transpose the javascript example into a dart one. JS Parse.Cloud.define('hello', function(request, response) { response.success('Hello world'); }); DART import 'dart:js' show allowInterop; import 'package:js/js.dart' show…
Druxtan
  • 1,311
  • 2
  • 15
  • 21
1
vote
1 answer

Compiled dart code errors with 'Invalid left-hand side in assignment' when deploying

I created a new project in Dart Editor with the template that prints "Your Dart app is running." to the page and compiled it to js. I put it to my localhost wamp server and it works fine. However, when I deploy and upload this dart web app to my web…
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
1
vote
1 answer

How to use the @MirrorUsed annotation on Serialization lib (dart2js)?

I using the serialization library (https://pub.dartlang.org/packages/serialization) to persiste and recover complex objects. An excellent library to convert complex objects (also converts to JSON!). Congratulations to Google people! However,…
Muka
  • 1,190
  • 1
  • 12
  • 27
1
vote
1 answer

Which specific browser-version does compiling to Javascript form dart are supported?

I have read "Browsers and compiling to JavaScript" FAQs section https://www.dartlang.org/support/faq.html There it says -> We support the following browsers: •Internet Explorer, versions 9, 10, and 11. •Dart v1.5 was the last release to support…
1
vote
1 answer

Uncaught TypeError: Cannot read property 'v0' of null in dart

I feel kinda silly asking this question but I have tried everything I know and even consulted the api docs all to no avail. My question is how to fix: Uncaught TypeError: Cannot read property 'v0' of null What I am doing is compiling a dart based…
dragonloverlord
  • 442
  • 5
  • 21
1
vote
1 answer

Metaprogramming performance in Dart

When using operator overloading in Dart, are the operating functions resolved at compile time, or at runtime, or something else? In which cases will the vm or dart2js be able to bypass something like this: function add(left, right) { if…
1
vote
1 answer

Error after compiling Polymer Dart to JS. (The "smoke" library has not been configured)

Аfter compiling Dart code (which use Dart Polymer) to JS. I get the following error: Uncaught Exception: The "smoke" library has not been configured. Make sure you import and configure one of the implementations (package:smoke/mirrors.dart or…
Timur Fayzrakhmanov
  • 17,967
  • 20
  • 64
  • 95
1
vote
1 answer

After using Pub Build - Minified on the pubspec.yaml of the order game, the board of the game does not appear in Chrome

dart2js problem After using Pub Build - Minified on the pubspec.yaml of the order game, the board of the game does not appear in Chrome. The boarding package uses enums and mixins. pubspec.yaml: name: order version: 0.2.7 author: Dzenan Ridjanovic…