-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spawnUri in dart2js does not generate the corresponding .dart.js file. #14984
Comments
Not sure if dart2js, or isolate issue. Added Area-Dart2JS, Library-Isolate, Triaged labels. |
This comment was originally written by [email protected] hi,it's an isolate issue,because i tested other codes without using spawnUri() and it worked. |
This comment was originally written by [email protected] cc @floitschG. |
You need to compile worker.dart yourself. Added AsDesigned label. |
Reopening and assigning to the Editor team. Maybe there are ways to make this easier. Removed Area-Dart2JS, Library-Isolate labels. |
cc @devoncarew. |
This comment was originally written by @sethladd It would be cool to right-click on a .dart file and run dart2js on it. |
This comment was originally written by @sethladd We can probably punt to I opened https://code.google.com/p/dart/issues/detail?id=16210 to track. |
With the editor now supporting pub serve and pub build, and being able to configure dart2js through pubspec, the user can compile to js as needed. Added AsDesigned label. |
This issue was originally filed by [email protected]
I'm running Dart Editor version 0.8.10_r30107 (STABLE) and Dart SDK version 0.8.10.10_r30107.
I saw issue #9422 been fixed and gave my sample code a try.However,It doesn't work in dart2js. I found the dart2js compiler did not generate the corresponding '.dart.js' file and the chrome dev tool console output:
Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:3030/spawn_uri/web/xxx.dart.js
After i manually run 'dart2js --out=xxx.dart.js xxx.dart' cmd under my source code directory and run the sample code again, it finally works.
Maybe it has something to do with Issue #8440?
P.S. main.dart has such a code line,
Isolate.spawnUri(Uri.parse("worker.dart"), [], response.sendPort);
Run html file via 'run as javascript' in dart editor and you will find such new generated files:
+main.dart.js
+main.dart.js.deps
+main.dart.js.map
+main.dart.precompiled.js
But it does not automatically generate such files,
-worker.dart.js
-worker.dart.js.deps
-worker.dart.js.map
-worker.dart.precompiled.js
Or just importing worker.dart into main.dart file and generate a single .dart.js file as a whole.
Attachment:
spawnuri.rar (3.75 KB)
The text was updated successfully, but these errors were encountered: