2
votes

I am new to Dart and want to start developing apps for Dart. Right now, I am simply using dart2js --minify for this, which works well, but is really slow when I need to debug my mistakes by changing the code, running the code, changing the code, running the code, etc.. This requires lots of compiling, so while dart2js is, in general, pretty fast, debugging Dart Web apps with dart2js is really slow.

I would like to use the Dart VM in Dartium and downloaded it per the directions of this video (although admittedly, I didn't watch the whole video because part of it was about Atom which I don't use). However, when I open Dartium (./chrome and ./chrome-wrapper), it doesn't look any different front regular Chrome. There is no --no-sandbox warning and the user agent is the same as in Chromium (no (Dart)). When I try to run a Dart Web app with <script type="application/dart" [...]>, it doesn't work.

I also get the following error when running Dartium (the same error occurs on ./chrome and ./chrome-wrapper):

[18997:18997:0829/163445:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
Created new window in existing browser session.
[19044:19044:0829/163446:ERROR:zygote_linux.cc(587)] write: Broken pipe
[0829/163446:ERROR:nacl_helper_linux.cc(282)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

However, when I go to the link in the error, the directions refer to a bunch of commands and files I don't recognize.

Can someone please help me figure out how to build Dartium? Thank you so much!

Additional Info:

  • I am running Ubuntu 15.04 and my default browser is Chromium.
  • When I ran both ./chrome and ./chrome-wrapper, I had my original Chromium closed.
  • I have uploaded my project to GitHub.
2
I get the same error message when I start Dartium from command line without arguments. I usually start Dartium from WebStorm and there such messages aren't visible but I also never had issues which seem related to this error. See my answer for more information. If you still can't make it work, please provide more information about your project (pubspec.yaml, directory structure, source file content) - Günter Zöchbauer
If you want to see my project, you can go here. - Noble Mushtak
I took a brief look and all seems fine. Seeing you accepted my project I assume you got it working. Don't hesitate to ask if you're stuck again. - Günter Zöchbauer

2 Answers

2
votes

Maybe Dartium is connecting to an existing version of Chromium. Try to launch Dartium with --user-data-dir=/tmp/dartium_dir. This will make sure that it launches separately from any existing Chromium.

1
votes

I guess the best way to check if you run Dartium is to enter about://version in the URL bar and check if Dart: someversion is listed. I usually start Dartium from WebStorm which lists the following command line in about://version

/usr/local/apps/dart/dartium/chrome --no-sandbox --flag-switches-begin --disable-async-dns --enable-devtools-experiments --enable-download-resumption --javascript-harmony --enable-panels --flag-switches-end

Instead of dart2js it's usually simpler to use pub build. pub build is usually used for deployment only. For development it usually works best to run the Dart development web server pub serve. Pub serve builds to JavaScript on the fly when a non-Dart-capable browser requests a page. If Dartium requests a page it serves the Dart source code instead. If your source changes you automatically get the updates JS when you reload the page in a non-Dart-capable browser.

(if you change dependencies with pub get or pub upgrade you need to restart pub serve)