Skip to content

chore: update min Next.js version, and log current #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions helpers/validateNextUsage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ If you are using a monorepo, please see the docs on configuring your site: https
// Old Next.js versions are not supported
// eslint-disable-next-line import/no-dynamic-require
const { version } = require(resolveNextModule(`next/package.json`, nextRoot))

console.log(`Using Next.js ${yellowBright(version)}`)

if (ltVersion(version, MIN_VERSION)) {
return failBuild(`Please upgrade to Next.js ${MIN_VERSION} or later. Found ${version}.`)
return failBuild(`Please upgrade to Next.js ${MIN_VERSION} or later.`)
}

// Recent Next.js versions are sometimes unstable and we might not officially
// support them yet. However, they might still work for some users, so we
// only print a warning
if (gteVersion(version, MIN_EXPERIMENTAL_VERSION)) {
console.log(yellowBright(`** Warning: support for Next.js >=${MIN_EXPERIMENTAL_VERSION} is experimental **`))
console.log(yellowBright(`Warning: support for Next.js >=${MIN_EXPERIMENTAL_VERSION} is experimental`))
}
}

const MIN_VERSION = '10.0.6'
const MIN_EXPERIMENTAL_VERSION = '11.0.0'
const MIN_EXPERIMENTAL_VERSION = '11.1.0'

const hasPackage = function (packageName, nextRoot) {
try {
Expand Down