Skip to content

Commit 59c742e

Browse files
Add instructions on how to add nextjs.org/docs/messages urls (#26865)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 2770619 commit 59c742e

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Choose the right checklist for the change that you're making:
88

99
- [ ] Related issues linked using `fixes #number`
1010
- [ ] Integration tests added
11+
- [ ] Errors have helpful link attached, see `contributing.md`
1112

1213
## Feature
1314

@@ -16,6 +17,7 @@ Choose the right checklist for the change that you're making:
1617
- [ ] Integration tests added
1718
- [ ] Documentation added
1819
- [ ] Telemetry added. In case of a feature if it's used or not.
20+
- [ ] Errors have helpful link attached, see `contributing.md`
1921

2022
## Documentation / Examples
2123

contributing.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Read about our [Commitment to Open Source](https://vercel.com/oss).
1414
1515
To contribute to [our examples](examples), take a look at the [“Adding examples” section](#adding-examples).
1616

17+
## Adding warning/error descriptions
18+
19+
In Next.js we have a system to add helpful links to warnings and errors.
20+
21+
This allows for the logged message to be short while giving a broader description and instructions on how to solve the warning/error.
22+
23+
In general all warnings and errors added should have these links attached.
24+
25+
Below are the steps to add a new link:
26+
27+
- Create a new markdown file under the `errors` directory based on `errors/template.md`: `cp errors/template.md errors/<error-file-name>.md`
28+
- Add the newly added file to `errors/manifest.json`
29+
- Add the following url to your warning/error: `https://nextjs.org/docs/messages/<file-path-without-dotmd>`. For example to link to `errors/api-routes-static-export.md` you use the url: `https://nextjs.org/docs/messages/api-routes-static-export`
30+
1731
## To run tests
1832

1933
Make sure you have `chromedriver` installed for your Chrome version. You can install it with
@@ -158,4 +172,4 @@ Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&ut
158172

159173
## Publishing
160174

161-
Repo maintainers can use `yarn publish-canary` to publish a new version of all packages to npm.
175+
Repository maintainers can use `yarn publish-canary` to publish a new version of all packages to npm.

errors/template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# <!-- INSERT TITLE HERE -->
2+
3+
#### Why This Error Occurred
4+
5+
<!-- Explain why the error occured. Ensure the description makes it clear why the warning/error exists -->
6+
7+
#### Possible Ways to Fix It
8+
9+
<!-- Explain how to fix the warning/error, potentially by providing alternative approaches. Ensure this section is actionable by users -->
10+
11+
### Useful Links
12+
13+
<!-- Add links to relevant documentation -->

0 commit comments

Comments
 (0)