Skip to content

Commit 045787b

Browse files
fix(wrangler): Show wrangler pages dev --proxy warning (#7041)
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.
1 parent 0e91d42 commit 045787b

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.changeset/odd-months-bake.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Show `wrangler pages dev --proxy` warning
6+
7+
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.

fixtures/pages-dev-proxy-with-script/tests/index.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ describe("Pages dev with proxy and a script file", () => {
2020
"Specifying a `-- <command>` or `--proxy` is deprecated and will be removed in a future version of Wrangler."
2121
)
2222
).toBeTruthy();
23+
24+
expect(
25+
process
26+
.getOutput()
27+
.includes(
28+
"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."
29+
)
30+
).toBeTruthy();
2331
});
2432

2533
it("should handle requests using a script from a custom script path", async () => {

packages/wrangler/src/pages/dev.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,11 @@ async function spawnProxyProcess({
10001000
`Specifying a \`-- <command>\` 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 <directory>\` instead.\nThis results in a more faithful emulation of production behavior.`
10011001
);
10021002
}
1003+
if (port !== undefined) {
1004+
logger.warn(
1005+
"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."
1006+
);
1007+
}
10031008
if (command.length === 0) {
10041009
if (port !== undefined) {
10051010
return port;

0 commit comments

Comments
 (0)