sorted-routes: fix "an required" → "a required" grammar in catch-all error#92937
Open
yogeshwaran-c wants to merge 1 commit intovercel:canaryfrom
Open
sorted-routes: fix "an required" → "a required" grammar in catch-all error#92937yogeshwaran-c wants to merge 1 commit intovercel:canaryfrom
yogeshwaran-c wants to merge 1 commit intovercel:canaryfrom
Conversation
…error
The "required + optional catch-all at the same level" error read
You cannot use both an required and optional catch-all route at the
same level ...
The article should be "a", not "an" (`required` starts with a consonant
sound). The other direction of the same error already uses correct
grammar — "an optional and required catch-all" — and a sibling error
later in `errors.json` (entry 911) already uses "a required and
optional", so this entry was the odd one out.
Updated the source string, the matching `toThrowErrorMatchingInlineSnapshot`
in `test/unit/page-route-sorter.test.ts`, and let `pnpm build` regenerate
the corresponding `errors.json` entry.
Reported as part of vercel#68933.
Collaborator
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fix the article in the "required + optional catch-all at the same level" error from
sorted-routes.ts. Today users see:```
You cannot use both an required and optional catch-all route at the same level
("[...one]" and "[[...one]]" )
```
requiredstarts with a consonant sound, so the article should be "a", not "an".Why?
Reported as part of #68933 — the issue body quotes the error verbatim and the typo is right there in
sorted-routes.ts:157. The other direction of the same error already uses correct grammar ("an optional and required catch-all"), and a sibling error later inerrors.json(entry 911 — "a required and optional catch-all route at the same level in route") already uses the corrected wording. This entry was the odd one out.It's purely a string fix — the matching test in
page-route-sorter.test.tsalready pinned the buggy wording viatoThrowErrorMatchingInlineSnapshot, so it's been a regression-stable typo for a while.How?
packages/next/src/shared/lib/router/utils/sorted-routes.ts:157.test/unit/page-route-sorter.test.ts.pnpm buildregenerate the correspondingerrors.jsonentry (new id 1165), which is how the repo manages these strings.No behavior change — only the wording.
Test plan
npx jest test/unit/page-route-sorter.test.ts— 15 passed, 19 snapshots passed (including the updated one for this error path).Reported in #68933.