Skip to content

Commit

Permalink
Add warning about different version of @next/font and next
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Bornö committed Nov 9, 2022
1 parent 3504491 commit 1954175
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/next/server/config.ts
Expand Up @@ -94,7 +94,14 @@ export function setHttpClientAndAgentOptions(config: {

function setFontLoaderDefaults(config: NextConfigComplete) {
try {
require.resolve('@next/font/google')
// eslint-disable-next-line import/no-extraneous-dependencies
const nextFontVersion = require('@next/font/package.json').version
const nextVersion = require('next/package.json').version
if (nextFontVersion !== nextVersion) {
Log.warn(
`Different versions of @next/font (${nextFontVersion}) and next (${nextVersion}) detected. This may lead to unexpected behavior.`
)
}

const googleFontLoader = {
loader: '@next/font/google',
Expand Down

0 comments on commit 1954175

Please sign in to comment.