diff --git a/.changeset/odd-months-bake.md b/.changeset/odd-months-bake.md new file mode 100644 index 000000000000..e4b821950cec --- /dev/null +++ b/.changeset/odd-months-bake.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +Show `wrangler pages dev --proxy` warning + +On Node.js 17+, wrangler will default to fetching only the IPv6 address. With these changes we warn users that the process listening on the port specified via `--proxy` should be configured for IPv6. diff --git a/fixtures/pages-dev-proxy-with-script/tests/index.test.ts b/fixtures/pages-dev-proxy-with-script/tests/index.test.ts index e13d93c1017f..b78f60846ab1 100644 --- a/fixtures/pages-dev-proxy-with-script/tests/index.test.ts +++ b/fixtures/pages-dev-proxy-with-script/tests/index.test.ts @@ -20,6 +20,14 @@ describe("Pages dev with proxy and a script file", () => { "Specifying a `-- ` or `--proxy` is deprecated and will be removed in a future version of Wrangler." ) ).toBeTruthy(); + + expect( + process + .getOutput() + .includes( + "On Node.js 17+, wrangler will default to fetching only the IPv6 address. Please ensure that the process listening on the port specified via `--proxy` is configured for IPv6." + ) + ).toBeTruthy(); }); it("should handle requests using a script from a custom script path", async () => { diff --git a/packages/wrangler/src/pages/dev.ts b/packages/wrangler/src/pages/dev.ts index 630e4bc71a41..f5d403bde031 100644 --- a/packages/wrangler/src/pages/dev.ts +++ b/packages/wrangler/src/pages/dev.ts @@ -1000,6 +1000,11 @@ async function spawnProxyProcess({ `Specifying a \`-- \` or \`--proxy\` is deprecated and will be removed in a future version of Wrangler.\nBuild your application to a directory and run the \`wrangler pages dev \` instead.\nThis results in a more faithful emulation of production behavior.` ); } + if (port !== undefined) { + logger.warn( + "On Node.js 17+, wrangler will default to fetching only the IPv6 address. Please ensure that the process listening on the port specified via `--proxy` is configured for IPv6." + ); + } if (command.length === 0) { if (port !== undefined) { return port;