Skip to content

Commit 5e57717

Browse files
Backport #8604 to Wrangler v3 (#8662)
* Amend `pages dev` error message when an environment is requested if users run `wrangler pages dev --env=my-env` they currently get an error saying to use `--branch` instead, the `--branch` option however only applies to `wrangler pages deploy`, so this error message can easily confuse users, the changes here update the error message to simply state that `--env` is not available for local development * fixup! Amend `pages dev` error message when an environment is requested fix formatting --------- Co-authored-by: Dario Piotrowicz <[email protected]>
1 parent 6f8e892 commit 5e57717

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/legal-camels-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Amend `pages dev` error message when an environment is requested

packages/wrangler/src/__tests__/pages/dev.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("pages dev", () => {
3838
await expect(
3939
runWrangler("pages dev public --env=production")
4040
).rejects.toThrowErrorMatchingInlineSnapshot(
41-
`[Error: Pages does not support targeting an environment with the --env flag. Use the --branch flag to target your production or preview branch]`
41+
`[Error: Pages does not support targeting an environment with the --env flag during local development.]`
4242
);
4343
});
4444
});

packages/wrangler/src/pages/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const Handler = async (args: PagesDevArguments) => {
274274

275275
if (args.env) {
276276
throw new FatalError(
277-
"Pages does not support targeting an environment with the --env flag. Use the --branch flag to target your production or preview branch",
277+
"Pages does not support targeting an environment with the --env flag during local development.",
278278
1
279279
);
280280
}

0 commit comments

Comments
 (0)