vercel/next.js · error
`@next/font` is only available in Next.js 13 and newer.
Error message
`@next/font` is only available in Next.js 13 and newer.
What it means
`@next/font/google` (the standalone legacy package) checks the installed `next` version at load time and throws this if it is below 13.0.0. `@next/font` was the App Router-era font integration; it requires Next.js 13+. In Next 13.2+ `@next/font` was superseded by the built-in `next/font`, so the standalone package is deprecated and only expected to run on >=13.
Source
Thrown at packages/font/google/index.js:4
// Validate next version
const semver = require('next/dist/compiled/semver')
if (semver.lt(require('next/package.json').version, '13.0.0')) {
throw new Error('`@next/font` is only available in Next.js 13 and newer.')
}
let message = '@next/font/google failed to run or is incorrectly configured.'
if (process.env.NODE_ENV === 'development') {
message +=
'\nIf you just installed `@next/font`, please try restarting `next dev` and resaving your file.'
}
message += `\n\nRead more: https://nextjs.org/docs/app/building-your-application/optimizing/fonts`
throw new Error(message)
View on GitHub (pinned to 0ae8c72462)
Solutions
- Upgrade to Next.js 13 or newer (`npm install next@latest`).
- Prefer the built-in `next/font/google` (import from `next/font/google`) instead of the standalone `@next/font` — it ships with Next 13.2+ and needs no extra dependency.
- If you must stay on Next 12, remove `@next/font` entirely; font optimization differs there.
- Verify the resolved `next` version (`node -e "console.log(require('next/package.json').version)"`) in the project root.
Example fix
// before (Next < 13, standalone package)
import { Inter } from '@next/font/google'
// after — built-in next/font (Next 13.2+)
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] }) Defensive patterns
Strategy: validation
Validate before calling
// Before importing @next/font, check next version; better, use next/font.
const nextVer = require('next/package.json').version
if (require('semver').lt(nextVer, '13.0.0')) {
throw new Error('Use Next 13+ or remove @next/font')
} Type guard
function isNext13Plus(): boolean {
const v = require('next/package.json').version
const [major] = v.split('.').map(Number)
return major >= 13
} Prevention
- Use the built-in next/font/google instead of @next/font.
- Keep next on >=13 when using @next/font.
- Pin next version in CI to avoid regressions.
When it happens
Trigger: `require('@next/font/google')` in a project whose `next/package.json` reports a version < 13.0.0. The semver check at the top of the file runs on first import.
Common situations: Installing `@next/font` in a Next 12 project (where it was never supported); monorepo with a hoisted older next resolving; accidentally depending on `@next/font` instead of the built-in `next/font/google`.
Related errors
- `@next/font` is only available in Next.js 13 and newer.
- @next/font/google failed to run or is incorrectly configured
- @next/font/local failed to run or is incorrectly configured.
- Could not find documentation for Next.js ${tag}. This versio
- Server Action "${actionId}" was not found on the server. Re
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/2e656aa96bd24269.
Report an issue: GitHub.