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/local` (standalone legacy package) throws this if the resolved `next` version is below 13.0.0. Same version gate as the google variant: `@next/font` is a Next 13+ integration. In Next 13.2+ the built-in `next/font/local` replaces it.

Source

Thrown at packages/font/local/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/local 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

  1. Upgrade to Next.js 13+ (`npm install next@latest`).
  2. Switch to the built-in `next/font/local` import (no extra dependency).
  3. Verify resolved next version with `node -e "console.log(require('next/package.json').version)"`.
  4. Remove the standalone `@next/font` dependency if you migrated to `next/font`.

Example fix

// before
import localFont from '@next/font/local'

// after
import localFont from 'next/font/local'
const myFont = localFont({ src: './my-font.woff2' })
Defensive patterns

Strategy: validation

Validate before calling

const nextVer = require('next/package.json').version
if (require('semver').lt(nextVer, '13.0.0')) {
  throw new Error('Local font via @next/font needs Next 13+; or use next/font/local.')
}

Type guard

function isNext13Plus(): boolean {
  const v = require('next/package.json').version
  return Number(v.split('.')[0]) >= 13
}

Prevention

When it happens

Trigger: `require('@next/font/local')` in a project whose `next/package.json` is < 13.0.0; runs on first import via the top-of-file semver check.

Common situations: Next 12 project with `@next/font` installed; hoisted older next in a monorepo; using the deprecated standalone package instead of `next/font/local`.

Related errors


AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06). Data as JSON: /api/errors/2273413b7a9fab59. Report an issue: GitHub.