Skip to content

Commit

Permalink
fix: upate cli preset with esm module format (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrutila committed Jun 17, 2024
1 parent e4f687d commit f6f2327
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/presets/node/runtime/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "#nitro-internal-pollyfills";
import { useNitroApp } from "nitropack/runtime";
import { normalize } from "pathe";

const nitroApp = useNitroApp();

Expand All @@ -13,13 +14,13 @@ async function cli() {
debug("StatusCode", r.status);
debug("StatusMessage", r.statusText);
// @ts-ignore
for (const header of r.headers.entries()) {
for (const header of Object.entries(r.headers)) {
debug(header[0], header[1]);
}
console.log("\n", r.body?.toString());
}

if (require.main === module) {
if (process.argv.some((arg) => import.meta.url.includes(normalize(arg)))) {
// eslint-disable-next-line unicorn/prefer-top-level-await
cli().catch((error) => {
console.error(error);
Expand Down

0 comments on commit f6f2327

Please sign in to comment.