This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
Cannot run dev_compiler on Windows - Exception thrown #276
Closed
Description
dev_compiler version: 0.1.5+1
System: Win 8.1
As per the recommendation here, I was trying to execute:
pub global run dev_compiler:devc -o outputdir --server file.dart
This is what I see in console:
Unhandled exception:
Uncaught Error: Invalid argument(s): Path must start with '/'
Stack Trace:
#0 MemoryResourceProvider.newFolder (package:analyzer/file_system/memory_file_system.dart:129)
#1 MemoryResourceProvider.newFile (package:analyzer/file_system/memory_file_system.dart:113)
#2 _createImplicitEntryResolver (package:dev_compiler/src/server/server.dart:291)
#3 DevServer.DevServer (package:dev_compiler/src/server/server.dart:214)
#4 compile.<compile_async_body> (package:dev_compiler/src/compiler.dart:71)
#5 Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#6 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#7 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#8 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:895)
#1 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#2 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)
I dag a bit into it. It seems like that the in the analyzer's memory_file_system.dart
file, posix
path context is used. This little example will demonstrate why that won't work on windows:
import 'package:path/path.dart';
void main() {
final String sillyWinPath = 'C:\\Users\\Daniel\\Documents\\Projects\\pretty.jpg';
var posixDirName = posix.dirname(sillyWinPath);
var winDirName = windows.dirname(sillyWinPath);
print("$winDirName | $posixDirName");
//> . | C:\Users\Daniel\Documents\Projects
}