diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart index a136652bb9a..ddb903c389f 100644 --- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart +++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart @@ -149,9 +149,12 @@ class SharedCompilerOptions { : (outPaths as List) .firstWhere((_) => true, orElse: () => null); + // TODO(jmesserly): fix the debugger console so it's not passing invalid + // options. + if (outPath == null) return null; if (moduleRoot != null) { - // TODO(jmesserly): remove this legacy support after a deprecation period. - // (Mainly this is to give time for migrating build rules.) + // TODO(jmesserly): remove this legacy support after a deprecation + // period. (Mainly this is to give time for migrating build rules.) moduleName = path.withoutExtension(path.relative(outPath, from: moduleRoot)); } else { diff --git a/pkg/dev_compiler/web/web_command.dart b/pkg/dev_compiler/web/web_command.dart index ac2b54f25ac..2904b5afe33 100644 --- a/pkg/dev_compiler/web/web_command.dart +++ b/pkg/dev_compiler/web/web_command.dart @@ -285,13 +285,13 @@ class WebCompileCommand extends Command { } resources.newFile(fileName, sourceCode); - compilerOptions.moduleName = path.toUri(libraryName).toString(); + var name = path.toUri(libraryName).toString(); + compilerOptions.moduleName = name; JSModuleFile module = compileWithAnalyzer(driver, [fileName], options, compilerOptions); var moduleCode = ''; if (module.isValid) { - var name = compilerOptions.moduleName; moduleCode = module.getCode(ModuleFormat.legacyConcat, name, name + '.map').code; }