Noble Mushtak
Noble Mushtak

Reputation: 1784

How to run Dartium on Linux?

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:

Upvotes: 2

Views: 1336

Answers (2)

Florian Loitsch
Florian Loitsch

Reputation: 8128

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.

Upvotes: 2

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657268

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)

Upvotes: 1

Related Questions