{"record":{"id":"2e656aa96bd24269","repo":"vercel/next.js","slug":"next-font-is-only-available-in-next-js-13-and-n","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/google/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/google 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/google/index.js#L1-L16","documentation":"`@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.","triggerScenarios":"`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.","commonSituations":"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`.","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."],"exampleFix":"// before (Next < 13, standalone package)\nimport { Inter } from '@next/font/google'\n\n// after — built-in next/font (Next 13.2+)\nimport { Inter } from 'next/font/google'\nconst inter = Inter({ subsets: ['latin'] })","handlingStrategy":"validation","validationCode":"// Before importing @next/font, check next version; better, use next/font.\nconst nextVer = require('next/package.json').version\nif (require('semver').lt(nextVer, '13.0.0')) {\n  throw new Error('Use Next 13+ or remove @next/font')\n}","typeGuard":"function isNext13Plus(): boolean {\n  const v = require('next/package.json').version\n  const [major] = v.split('.').map(Number)\n  return major >= 13\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["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"}