diff --git a/bin/async_compile.dart b/bin/async_compile.dart
index c40d54d95ceb1b8c9302f5920c93c20d358b4892..c0d13e64b14b7f9032bdd33e7c6a20c04720f49f 100644
--- a/bin/async_compile.dart
+++ b/bin/async_compile.dart
@@ -176,7 +176,7 @@ String _translateAsyncAwait(String sourcePath, String source) {
 String _fixDart2jsImports(String sourcePath, String source, String destPath) {
   var compilerDir = p.url.join(sourceUrl, "../compiler");
   var relative = p.url.relative(compilerDir,
-      from: p.dirname(p.toUri(destPath).toString()));
+      from: p.url.dirname(p.toUri(destPath).toString()));
   return source.replaceAll(_compilerPattern, "import '$relative");
 }