diff --git a/CHANGELOG.md b/CHANGELOG.md index d0e3727ac..6397a7741 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ * When printing suggestions for variables, use underscores in variable names when the original usage used underscores. +### JavaScript API + +* Properly resolve `pkg:` imports with the Node.js package importer when + arguments are passed to the JavaScript process. + ## 1.71.1 ### Command-Line Interface diff --git a/lib/src/js/utils.dart b/lib/src/js/utils.dart index 844157676..a6b269782 100644 --- a/lib/src/js/utils.dart +++ b/lib/src/js/utils.dart @@ -239,7 +239,7 @@ Syntax parseSyntax(String? syntax) => switch (syntax) { String? get entrypointFilename { if (_requireMain?.filename case var filename?) { return filename; - } else if (process.argv case [_, String path]) { + } else if (process.argv case [_, String path, ...]) { return module.createRequire(path).resolve(path); } else { return null;