Unverified Commit 60488e68 authored by Maedah Batool's avatar Maedah Batool Committed by GitHub

Fix broken data fetching links in docs (#33766)

* Fix broken links for Data Fetching

* Fix link data fetching doc

* Improve link file paths

* Update errors/large-page-data.md
Co-authored-by: 's avatarSteven <steven@ceriously.com>

* Update links

* Fix linting

* Lint tests

* Lint tests
Co-authored-by: 's avatarSteven <steven@ceriously.com>
Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
parent 0e02f204
...@@ -81,23 +81,23 @@ This will take precedence over the configuration from `next.config.js`. ...@@ -81,23 +81,23 @@ This will take precedence over the configuration from `next.config.js`.
Next.js provides an ESLint plugin, [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next), already bundled within the base configuration that makes it possible to catch common issues and problems in a Next.js application. The full set of rules is as follows: Next.js provides an ESLint plugin, [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next), already bundled within the base configuration that makes it possible to catch common issues and problems in a Next.js application. The full set of rules is as follows:
| | Rule | Description | | | Rule | Description |
| :-: | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | :-: | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| ✔️ | [next/google-font-display](https://nextjs.org/docs/messages/google-font-display) | Enforce optional or swap font-display behavior with Google Fonts | | ✔️ | [next/google-font-display](/docs/messages/google-font-display.md) | Enforce optional or swap font-display behavior with Google Fonts |
| ✔️ | [next/google-font-preconnect](https://nextjs.org/docs/messages/google-font-preconnect) | Enforce preconnect usage with Google Fonts | | ✔️ | [next/google-font-preconnect](/docs/messages/google-font-preconnect.md) | Enforce preconnect usage with Google Fonts |
| ✔️ | [next/link-passhref](https://nextjs.org/docs/messages/link-passhref) | Enforce passHref prop usage with custom Link components | | ✔️ | [next/link-passhref](/docs/messages/link-passhref.md) | Enforce passHref prop usage with custom Link components |
| ✔️ | [next/no-css-tags](https://nextjs.org/docs/messages/no-css-tags) | Prevent manual stylesheet tags | | ✔️ | [next/no-css-tags](/docs/messages/no-css-tags.md) | Prevent manual stylesheet tags |
| ✔️ | [next/no-document-import-in-page](https://nextjs.org/docs/messages/no-document-import-in-page) | Disallow importing next/document outside of pages/document.js | | ✔️ | [next/no-document-import-in-page](/docs/messages/no-document-import-in-page.md) | Disallow importing next/document outside of pages/document.js |
| ✔️ | [next/no-head-import-in-document](https://nextjs.org/docs/messages/no-head-import-in-document) | Disallow importing next/head in pages/document.js | | ✔️ | [next/no-head-import-in-document](/docs/messages/no-head-import-in-document.md) | Disallow importing next/head in pages/document.js |
| ✔️ | [next/no-html-link-for-pages](https://nextjs.org/docs/messages/no-html-link-for-pages) | Prohibit HTML anchor links to pages without a Link component | | ✔️ | [next/no-html-link-for-pages](/docs/messages/no-html-link-for-pages.md) | Prohibit HTML anchor links to pages without a Link component |
| ✔️ | [next/no-img-element](https://nextjs.org/docs/messages/no-img-element) | Prohibit usage of HTML &lt;img&gt; element | | ✔️ | [next/no-img-element](/docs/messages/no-img-element.md) | Prohibit usage of HTML &lt;img&gt; element |
| ✔️ | [next/no-head-element](https://nextjs.org/docs/messages/no-head-element) | Prohibit usage of HTML &lt;head&gt; element | | ✔️ | [next/no-head-element](/docs/messages/no-head-element.md) | Prohibit usage of HTML &lt;head&gt; element |
| ✔️ | [next/no-page-custom-font](https://nextjs.org/docs/messages/no-page-custom-font) | Prevent page-only custom fonts | | ✔️ | [next/no-page-custom-font](/docs/messages/no-page-custom-font.md) | Prevent page-only custom fonts |
| ✔️ | [next/no-sync-scripts](https://nextjs.org/docs/messages/no-sync-scripts) | Forbid synchronous scripts | | ✔️ | [next/no-sync-scripts](/docs/messages/no-sync-scripts.md) | Forbid synchronous scripts |
| ✔️ | [next/no-title-in-document-head](https://nextjs.org/docs/messages/no-title-in-document-head) | Disallow using &lt;title&gt; with Head from next/document | | ✔️ | [next/no-title-in-document-head](/docs/messages/no-title-in-document-head.md) | Disallow using &lt;title&gt; with Head from next/document |
| ✔️ | [next/no-unwanted-polyfillio](https://nextjs.org/docs/messages/no-unwanted-polyfillio) | Prevent duplicate polyfills from Polyfill.io | | ✔️ | [next/no-unwanted-polyfillio](/docs/messages/no-unwanted-polyfillio.md) | Prevent duplicate polyfills from Polyfill.io |
| ✔️ | [next/inline-script-id](https://nextjs.org/docs/messages/inline-script-id) | Enforce id attribute on next/script components with inline content | | ✔️ | [next/inline-script-id](/docs/messages/inline-script-id.md) | Enforce id attribute on next/script components with inline content |
| ✔️ | next/no-typos | Ensure no typos were made declaring [Next.js's data fetching function](https://nextjs.org/docs/basic-features/data-fetching) | | ✔️ | next/no-typos | Ensure no typos were made declaring [Next.js's data fetching function](/docs/basic-features/data-fetching/overview.md) |
| ✔️ | [next/next-script-for-ga](https://nextjs.org/docs/messages/next-script-for-ga) | Use the Script component to defer loading of the script until necessary. | | ✔️ | [next/next-script-for-ga](/docs/messages/next-script-for-ga.md) | Use the Script component to defer loading of the script until necessary. |
- ✔: Enabled in the recommended configuration - ✔: Enabled in the recommended configuration
......
...@@ -65,4 +65,4 @@ export default function CatchAll() { ...@@ -65,4 +65,4 @@ export default function CatchAll() {
### Useful Links ### Useful Links
- [`getStaticPaths` Documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths) - [`getStaticPaths` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths)
...@@ -10,4 +10,4 @@ Remove any paths that result in a redirect from being prerendered in `getStaticP ...@@ -10,4 +10,4 @@ Remove any paths that result in a redirect from being prerendered in `getStaticP
### Useful Links ### Useful Links
- [Data Fetching Documentation](/docs/basic-features/data-fetching/get-static-props.md) - [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
...@@ -33,6 +33,6 @@ The `getServerSideProps` lifecycle is not compatible with `next export`, so you' ...@@ -33,6 +33,6 @@ The `getServerSideProps` lifecycle is not compatible with `next export`, so you'
### Useful Links ### Useful Links
- [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) - [Automatic Static Optimization](https://nextjs.org/docs/advanced-features/automatic-static-optimization)
- [`getStaticProps` documentation](/docs/basic-features/data-fetching/get-static-props.md) - [`getStaticProps` documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
- [`exportPathMap` documentation](/docs/api-reference/next.config.js/exportPathMap.md) - [`exportPathMap` documentation](https://nextjs.org/docs/api-reference/next.config.js/exportPathMap)
...@@ -12,5 +12,5 @@ Make sure only `notFound` **or** `redirect` is being returned on your page's `ge ...@@ -12,5 +12,5 @@ Make sure only `notFound` **or** `redirect` is being returned on your page's `ge
### Useful Links ### Useful Links
- [`getStaticProps` Documentation](/docs/basic-features/data-fetching/get-static-props.md) - [`getStaticProps` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
- [`getServerSideProps` Documentation](/docs/basic-features/data-fetching/get-server-side-props.md) - [`getServerSideProps` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props)
...@@ -16,4 +16,4 @@ If you’re using a custom server and running into this problem due to session m ...@@ -16,4 +16,4 @@ If you’re using a custom server and running into this problem due to session m
### Useful Links ### Useful Links
- [Data Fetching Docs](https://nextjs.org/docs/basic-features/data-fetching) - [Data Fetching Docs](https://nextjs.org/docs/basic-features/data-fetching/index)
...@@ -29,4 +29,4 @@ export const getStaticProps = ({ params }) => { ...@@ -29,4 +29,4 @@ export const getStaticProps = ({ params }) => {
### Useful Links ### Useful Links
- [Data Fetching Documentation](/docs/basic-features/data-fetching/get-static-props.md) - [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
...@@ -10,4 +10,4 @@ Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`, ...@@ -10,4 +10,4 @@ Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`,
### Useful Links ### Useful Links
- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching) - [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/overview)
...@@ -15,4 +15,5 @@ When restarted it will retry all uncompleted jobs, but if a job was unsuccessful ...@@ -15,4 +15,5 @@ When restarted it will retry all uncompleted jobs, but if a job was unsuccessful
### Useful Links ### Useful Links
- [`getStaticPaths`](/docs/basic-features/data-fetching/get-static-paths.md) - [`getStaticPaths`](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths)
- [`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
...@@ -11,4 +11,4 @@ While prerendering a page an error occurred. This can occur for many reasons fro ...@@ -11,4 +11,4 @@ While prerendering a page an error occurred. This can occur for many reasons fro
- Set default values for all dynamic pages' props (avoid `undefined`, use `null` instead so it can be serialized) - Set default values for all dynamic pages' props (avoid `undefined`, use `null` instead so it can be serialized)
- Check for any out of date modules that you might be relying on - Check for any out of date modules that you might be relying on
- Make sure your component handles `fallback` if it is enabled in `getStaticPaths`. [Fallback docs](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-false) - Make sure your component handles `fallback` if it is enabled in `getStaticPaths`. [Fallback docs](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-false)
- Make sure you are not trying to export (`next export`) pages that have server-side rendering enabled [(getServerSideProps)](/docs/basic-features/data-fetching/get-server-side-props.md) - Make sure you are not trying to export (`next export`) pages that have server-side rendering enabled [(getServerSideProps)](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props)
...@@ -11,4 +11,4 @@ If you would like the `fallback: true` behavior, `next export` should not be use ...@@ -11,4 +11,4 @@ If you would like the `fallback: true` behavior, `next export` should not be use
### Useful Links ### Useful Links
- [deployment documentation](https://nextjs.org/docs/deployment#vercel-recommended) - [deployment documentation](https://nextjs.org/docs/deployment#vercel-recommended)
- [`fallback: true` documentation](https://nextjs.org/docs/basic-features/data-fetching#fallback-true) - [`fallback: true` documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-true)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment