title: webdev error when ran without pub on windows
body: <p>I do AngularDart development on Windows 10. I'm getting strange behavior with webdev recently. I have to run webdev like this: </p>
  
  <pre><code>C:\Users\galankus&gt;C:\tools\dart-sdk\bin\pub.bat global run webdev
  A tool to develop Dart web projects.
  
  Usage: webdev &lt;command&gt; [arguments]
  
  Global options:
  -h, --help    Print this usage information.
  
  Available commands:
    build   Run builders to build a package.
    help    Display help information for webdev.
    serve   Run a local web development server and a file system watcher that re-builds on changes.
  
  Run "webdev help &lt;command&gt;" for more information about a command.
  </code></pre>
  
  <p>If I try to run it directly, the below is what I get. Any ideas on how I can debug/fix this? </p>
  
  <pre><code>C:\Users\galankus&gt;webdev
  Crash when formatting: [Encoding] Unable to decode bytes as UTF-8.
  RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
  #0      _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
  #1      Source.getTextLine (package:kernel/ast.dart:5772:42)
  #2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
  #3      format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
  #4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
  #5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
  #6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
  #7      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
  #8      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
  #9      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
  #10     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
  &lt;asynchronous suspension&gt;
  #11     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
  &lt;asynchronous suspension&gt;
  #12     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
  &lt;asynchronous suspension&gt;
  #13     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
  &lt;asynchronous suspension&gt;
  #14     IncrementalCompiler.computeDelta.&lt;anonymous closure&gt; (package:front_end/src/fasta/incremental_compiler.dart:232:24)
  &lt;asynchronous suspension&gt;
  #15     CompilerContext.runInContext.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:46)
  #16     new Future.sync (dart:async/future.dart:222:31)
  #17     CompilerContext.runInContext.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:19)
  #18     _rootRun (dart:async/zone.dart:1126:13)
  #19     _CustomZone.run (dart:async/zone.dart:1023:19)
  #20     _runZoned (dart:async/zone.dart:1518:10)
  #21     runZoned (dart:async/zone.dart:1465:12)
  #22     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
  #23     IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
  &lt;asynchronous suspension&gt;
  #24     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
  &lt;asynchronous suspension&gt;
  #25     IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
  &lt;asynchronous suspension&gt;
  #26     Compiler.compile.&lt;anonymous closure&gt; (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
  #27     new Future.&lt;anonymous closure&gt; (dart:async/future.dart:174:37)
  #28     _rootRun (dart:async/zone.dart:1122:38)
  #29     _CustomZone.run (dart:async/zone.dart:1023:19)
  #30     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
  #31     _CustomZone.bindCallbackGuarded.&lt;anonymous closure&gt; (dart:async/zone.dart:965:23)
  #32     _rootRun (dart:async/zone.dart:1126:13)
  #33     _CustomZone.run (dart:async/zone.dart:1023:19)
  #34     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:949:23)
  #35     Timer._createTimer.&lt;anonymous closure&gt; (dart:async/runtime/libtimer_patch.dart:21:15)
  #36     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
  #37     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
  #38     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
  
  Crash when compiling file:///C:/Users/galankus/AppData/Roaming/Pub/Cache/global_packages/webdev/bin/webdev.dart.snapshot,
  at character offset 264110:
  RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
  #0      _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
  #1      Source.getTextLine (package:kernel/ast.dart:5772:42)
  #2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
  #3      format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
  #4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
  #5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
  #6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
  #7      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
  #8      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
  #9      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
  #10     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
  &lt;asynchronous suspension&gt;
  #11     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
  &lt;asynchronous suspension&gt;
  #12     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
  &lt;asynchronous suspension&gt;
  #13     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
  &lt;asynchronous suspension&gt;
  #14     IncrementalCompiler.computeDelta.&lt;anonymous closure&gt; (package:front_end/src/fasta/incremental_compiler.dart:232:24)
  &lt;asynchronous suspension&gt;
  #15     CompilerContext.runInContext.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:46)
  #16     new Future.sync (dart:async/future.dart:222:31)
  #17     CompilerContext.runInContext.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:19)
  #18     _rootRun (dart:async/zone.dart:1126:13)
  #19     _CustomZone.run (dart:async/zone.dart:1023:19)
  #20     _runZoned (dart:async/zone.dart:1518:10)
  #21     runZoned (dart:async/zone.dart:1465:12)
  #22     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
  #23     IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
  &lt;asynchronous suspension&gt;
  #24     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
  &lt;asynchronous suspension&gt;
  #25     IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
  &lt;asynchronous suspension&gt;
  #26     Compiler.compile.&lt;anonymous closure&gt; (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
  #27     new Future.&lt;anonymous closure&gt; (dart:async/future.dart:174:37)
  #28     _rootRun (dart:async/zone.dart:1122:38)
  #29     _CustomZone.run (dart:async/zone.dart:1023:19)
  #30     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
  #31     _CustomZone.bindCallbackGuarded.&lt;anonymous closure&gt; (dart:async/zone.dart:965:23)
  #32     _rootRun (dart:async/zone.dart:1126:13)
  #33     _CustomZone.run (dart:async/zone.dart:1023:19)
  #34     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:949:23)
  #35     Timer._createTimer.&lt;anonymous closure&gt; (dart:async/runtime/libtimer_patch.dart:21:15)
  #36     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
  #37     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
  #38     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
  
  
  #0      _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
  #1      Source.getTextLine (package:kernel/ast.dart:5772:42)
  #2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
  #3      format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
  #4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
  #5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
  #6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
  #7      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
  #8      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
  #9      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
  #10     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
  &lt;asynchronous suspension&gt;
  #11     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
  &lt;asynchronous suspension&gt;
  #12     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
  &lt;asynchronous suspension&gt;
  #13     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
  &lt;asynchronous suspension&gt;
  #14     IncrementalCompiler.computeDelta.&lt;anonymous closure&gt; (package:front_end/src/fasta/incremental_compiler.dart:232:24)
  &lt;asynchronous suspension&gt;
  #15     CompilerContext.runInContext.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:46)
  #16     new Future.sync (dart:async/future.dart:222:31)
  #17     CompilerContext.runInContext.&lt;anonymous closure&gt; (package:front_end/src/fasta/compiler_context.dart:118:19)
  #18     _rootRun (dart:async/zone.dart:1126:13)
  #19     _CustomZone.run (dart:async/zone.dart:1023:19)
  #20     _runZoned (dart:async/zone.dart:1518:10)
  #21     runZoned (dart:async/zone.dart:1465:12)
  #22     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
  #23     IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
  &lt;asynchronous suspension&gt;
  #24     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
  &lt;asynchronous suspension&gt;
  #25     IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
  &lt;asynchronous suspension&gt;
  #26     Compiler.compile.&lt;anonymous closure&gt; (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
  #27     new Future.&lt;anonymous closure&gt; (dart:async/future.dart:174:37)
  #28     _rootRun (dart:async/zone.dart:1122:38)
  #29     _CustomZone.run (dart:async/zone.dart:1023:19)
  #30     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
  #31     _CustomZone.bindCallbackGuarded.&lt;anonymous closure&gt; (dart:async/zone.dart:965:23)
  #32     _rootRun (dart:async/zone.dart:1126:13)
  #33     _CustomZone.run (dart:async/zone.dart:1023:19)
  #34     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:949:23)
  #35     Timer._createTimer.&lt;anonymous closure&gt; (dart:async/runtime/libtimer_patch.dart:21:15)
  #36     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
  #37     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
  #38     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
  </code></pre>
  
  <p>Edit: the below did not change anything, I still get the error above. </p>
  
  <pre><code>C:\Users\galankus&gt;pub global activate webdev
  Package webdev is currently active at version 0.2.3.
  Resolving dependencies...
  + args 1.4.3
  + charcode 1.1.1
  + collection 1.14.10
  + io 0.3.2+1
  + meta 1.1.5
  + path 1.6.1
  + pub_semver 1.4.1
  + source_span 1.4.0
  + stack_trace 1.9.2
  + string_scanner 1.0.2
  + webdev 0.2.3
  + yaml 2.1.14
  Precompiling executables...
  Precompiled webdev:bin\webdev.
  Installed executable webdev.
  Activated webdev 0.2.3.
  </code></pre>