bac00ba7d7
Print warning with migration instructions if `@next/font` is in deps. Fixes NEXT-483 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --------- Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
18 lines
579 B
Markdown
18 lines
579 B
Markdown
# Built-in `next/font`
|
|
|
|
#### Why This Error Occurred
|
|
|
|
Starting with Next.js 13.2, `next/font` is built-in to Next.js and no longer needs to be installed. The `@next/font` package will be removed in Next.js 14.
|
|
|
|
#### Possible Ways to Fix It
|
|
|
|
Run the `built-in-next-font` codemod to automatically uninstall `@next/font` and change `@next/font` imports to `next/font`:
|
|
|
|
```sh
|
|
npx @next/codemod built-in-next-font .
|
|
```
|
|
|
|
### Useful Links
|
|
|
|
- [Codemods](https://nextjs.org/docs/advanced-features/codemods)
|
|
- [Optimizing Fonts](https://nextjs.org/docs/basic-features/font-optimization)
|