Skip to content

Commit 9c87399

Browse files
committed
fixup! fix(metro-service): lazy-load node-fetch to avoid punycode warning
1 parent ea8ca79 commit 9c87399

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/metro-service/src/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { requireModuleFromMetro } from "@rnx-kit/tools-react-native/metro";
22
import type { runServer } from "metro";
3-
import net from "net";
3+
import net from "node:net";
44
import { ensureBabelConfig } from "./babel";
55

66
type ServerStatus = "not_running" | "already_running" | "in_use" | "unknown";
@@ -12,7 +12,8 @@ function getFetchImpl(): (url: string | URL) => Promise<Response> {
1212

1313
// TODO: Remove `node-fetch` when we drop support for Node 16
1414
// @ts-expect-error To be removed when Node 16 is no longer supported
15-
return (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args));
15+
return (...args) =>
16+
import("node-fetch").then(({ default: fetch }) => fetch(...args));
1617
}
1718

1819
/**

0 commit comments

Comments
 (0)