Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wrangler): Show wrangler pages dev --proxy warning #7041

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/odd-months-bake.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions fixtures/pages-dev-proxy-with-script/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ describe("Pages dev with proxy and a script file", () => {
"Specifying a `-- <command>` 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 () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/wrangler/src/pages/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,11 @@ async function spawnProxyProcess({
`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.`
);
}
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;
Expand Down
Loading