dart-atom / dart

A Dart plugin for Atom.
http://dart-atom.github.io/dart/
BSD 3-Clause "New" or "Revised" License
154 stars 44 forks source link

The built-in library 'dart:html' is not available on the stand-alone VM. #1115

Closed nbro closed 7 years ago

nbro commented 7 years ago

I'm really new to Dart and, actually, I still need to learn the language. But I was setting up Atom as my developing environment to use this plug-in. A button "to run" appeared on a panel on top of the editor, so I clicked it, and I received the following error:

web/main.dart • ~/Desktop/tests/test2 • checked mode • debug
The built-in library 'dart:html' is not available on the stand-alone VM.
'file:///Users/cell/Desktop/tests/test2/web/main.dart': error: line 4 pos 1: library handler failed
import 'dart:html';
^
Unable to connect to the observatory (port 16199).
process finished • exit code 254

Apparently this error occurs because I'm not developing on Dartium, and .dart files can only run on Dartium. So I built first (on the terminal), using pub build, the project created using stagehand.

My question are: When is this "run" button really useful? Is there a way to build the project by clicking that button instead of doing what it actually does?

Maybe it would be better first to learn the language and I would probably understand the differences here...

devoncarew commented 7 years ago

This plugin can't launch web projects, just CLI ones. The best workflow for using this plugin with web development is to edit in atom, run your server from the CLI, and open/refresh the app in dartium.

Thanks for the issue!