{"record":{"id":"2273413b7a9fab59","repo":"vercel/next.js","slug":"next-font-is-only-available-in-next-js-13-and-n-227341","errorCode":null,"errorMessage":"`@next/font` is only available in Next.js 13 and newer.","messagePattern":"`@next/font` is only available in Next\\.js 13 and newer\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/font/local/index.js","lineNumber":4,"sourceCode":"// Validate next version\nconst semver = require('next/dist/compiled/semver')\nif (semver.lt(require('next/package.json').version, '13.0.0')) {\n  throw new Error('`@next/font` is only available in Next.js 13 and newer.')\n}\n\nlet message = '@next/font/local failed to run or is incorrectly configured.'\nif (process.env.NODE_ENV === 'development') {\n  message +=\n    '\\nIf you just installed `@next/font`, please try restarting `next dev` and resaving your file.'\n}\n\nmessage += `\\n\\nRead more: https://nextjs.org/docs/app/building-your-application/optimizing/fonts`\n\nthrow new Error(message)\n","sourceCodeStart":1,"sourceCodeEnd":16,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/font/local/index.js#L1-L16","documentation":"`@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.","triggerScenarios":"`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.","commonSituations":"Next 12 project with `@next/font` installed; hoisted older next in a monorepo; using the deprecated standalone package instead of `next/font/local`.","solutions":["Upgrade to Next.js 13+ (`npm install next@latest`).","Switch to the built-in `next/font/local` import (no extra dependency).","Verify resolved next version with `node -e \"console.log(require('next/package.json').version)\"`.","Remove the standalone `@next/font` dependency if you migrated to `next/font`."],"exampleFix":"// before\nimport localFont from '@next/font/local'\n\n// after\nimport localFont from 'next/font/local'\nconst myFont = localFont({ src: './my-font.woff2' })","handlingStrategy":"validation","validationCode":"const nextVer = require('next/package.json').version\nif (require('semver').lt(nextVer, '13.0.0')) {\n  throw new Error('Local font via @next/font needs Next 13+; or use next/font/local.')\n}","typeGuard":"function isNext13Plus(): boolean {\n  const v = require('next/package.json').version\n  return Number(v.split('.')[0]) >= 13\n}","tryCatchPattern":null,"preventionTips":["Use next/font/local instead of @next/font/local.","Keep Next >=13 when using @next/font.","Verify resolved next version in monorepos."],"tags":["font","local-font","version-mismatch","next-13","deprecation","semver"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}