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
0
votes
0 answers

Dart: pub build does not appear to build files expected by Dart Polymer

I am trying to build a Dart client-side project using Polymer. I have followed numerous different instructions found online. For example I have followed the instructions given…
Nigel W
  • 21
  • 4
0
votes
1 answer

how to avoid dart2js discarding my angulardart callback

I have a function that I think is being discarded by dart2js because it's only used in a AngularDart NgCallback, like this: So, myCallback is exposed from my-component…
Victor M.
  • 1,004
  • 8
  • 10
0
votes
0 answers

Uncaught error: Illegal arguments running Dart compiled to js in Safari

Ok, not sure how easy this is going to be to get help with but here goes... So there is Dart code I am dealing with which uses polymer, and perhaps another relevant detail is that there are a lot of Futures in it. When accessing the web page (you…
The Ice Mage
  • 445
  • 1
  • 7
  • 17
0
votes
1 answer

dart2js's output causes "null is not an object"

After running private/dart/dart-sdk/bin/dart2js -m -o public/js/script.js private/dart/script.dart The resulting javascript returns TypeError: 'null' is not an object (evaluating 'J.RE(a).gVs') However, the error while not minified is TypeError:…
Cereal
  • 3,699
  • 2
  • 23
  • 36
0
votes
1 answer

dart2js build 'file:///Users/'

When I do a dart2js build, the bootstrap.dart.js javascript reference's my file system a lot. If you do a search for 'file:///Users/' within the file it shows the file system path of the build user. This means I get file not found errors on other…
robbie
  • 269
  • 1
  • 9
0
votes
1 answer

"SpeechSynthesisUtterance is not defined" in Chrome and Firefox

The following Dart code does not work on Chrome or Firefox. import 'dart:html'; void main() { SpeechSynthesisUtterance speechSynthesisUtterance = new SpeechSynthesisUtterance(); speechSynthesisUtterance.lang = 'en-US'; …
Nawaf Alsulami
  • 699
  • 1
  • 8
  • 15
0
votes
1 answer

dart2js Uncaught TypeError cannot read property

When I compile my dart2js I keep getting an error from the shadow_dom.debug.js Uncaught TypeError: Cannot read property 'st885323213750055768' of undefined Does anyone what this property is?
robbie
  • 269
  • 1
  • 9
0
votes
2 answers

dart2js code fails to load http responses

This dart code sends a json string to the next server-side code and receives a response back. The dart code works. But the dart2js-compiled js code fails to load the http response with an error. Is this a bug in dart2js? Or am I doing something…
Nawaf Alsulami
  • 699
  • 1
  • 8
  • 15
0
votes
1 answer

"Run as JavaScript" does not work with my dart web app?

I cannot find the reason why my app does not work when compiled to JavaScript using dart2js. I have tried debugging my compiled JavaScript app using Google DevTools but found it very difficult to understand both the debugger and JavaScript code. You…
Nawaf Alsulami
  • 699
  • 1
  • 8
  • 15
0
votes
1 answer

How to get dart2js javascript that uses canvas.context2D to work on firefox or safari?

I have program that seems to compile with dart2js enough for UI such as checkbox working, and even can do CanvasRenderingContext2D context=canvas.context2D; context ..setFillColorRgb(200,200,250,1) ..beginPath() ..fillRect(0,0,width,…
si t
  • 1
  • 3
0
votes
1 answer

How to use javascript polyfills with dart2js

I want to use indexedDB polyfill with Dart code compiled to Javascript. When i just added required script, dart2js code does not recognize window.indexedDB property as IDBFactory instance and produce UnknownJavaScriptObject interceptor. I tried to…
MDerks
  • 123
  • 5
0
votes
1 answer

'Mi' is not a subtype of type 'IF' with dart2js

I'm facing an issue with dart2js since today, dart2js go to the end without any error, but when i launch my webapp on a browser (Chrome) the console send this error "Uncaught type 'Mi' is not a subtype of type 'IF' " But when running on Dartium,…
0
votes
1 answer

Automate transpiling entire Dart project into single file?

I'm new to Dart and trying to understand the JavaScript compilation process. After doing to reading, I can't seem to find a way to automatically build an entire project of Dart files at once. Am I missing something? Thanks
Antiga
  • 2,264
  • 1
  • 20
  • 28
0
votes
2 answers

Dart JavaScript output fails with: method not found: 'new ToDos:1:0' Receiver: Instance of 'JsClassMirror'

I've ported a handy JS library to Dart: dartscale. The crucial part of it's functionality can be broken down to: final Map _registeredModules = new Map(); register(module, [String moduleName]) { final…
martyglaubitz
  • 992
  • 10
  • 21
-1
votes
1 answer

Filter Dart files during dart2js process launch by 'pub build' command

is it possible to filter dart files during 'pub build => dart2js' ? I'm working with a microservice architecture where I need to specify a variable in the code according to the environement type ( integration vs production). The common use case…
bwnyasse
  • 591
  • 1
  • 10
  • 15
1 2 3
13
14