Skip to content
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

Add warning for Yarn PnP v3 with Node.js < 16.14 #34818

Merged
merged 5 commits into from Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/next/bin/next.ts
Expand Up @@ -105,6 +105,19 @@ if (process.env.NODE_ENV) {

;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv

// x-ref: https://github.com/vercel/next.js/pull/34688#issuecomment-1047994505
if (process.versions.pnp === '3') {
const nodeVersionParts = process.versions.node
.split('.')
.map((v) => Number(v))

if (nodeVersionParts[0] < 16 || nodeVersionParts[1] < 14) {
ijjk marked this conversation as resolved.
Show resolved Hide resolved
log.warn(
'Starting with Yarn PnP v3.20, Node.js >= v16.14 is required to work correctly see here for more info: https://github.com/vercel/next.js/pull/34688#issuecomment-1047994505'
ijjk marked this conversation as resolved.
Show resolved Hide resolved
)
}
}

// Make sure commands gracefully respect termination signals (e.g. from Docker)
process.on('SIGTERM', () => process.exit(0))
process.on('SIGINT', () => process.exit(0))
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/yarn-pnp/test/utils.ts
Expand Up @@ -41,6 +41,12 @@ export function runTests(example = '') {
})
afterAll(() => next?.destroy())

it('should warn on not fully supported node versions', async () => {
expect(next.cliOutput).toContain(
'Starting with Yarn PnP v3.20, Node.js >= v16.14 is required to work correctly see here for more info'
ijjk marked this conversation as resolved.
Show resolved Hide resolved
)
})

it(`should compile and serve the index page correctly ${example}`, async () => {
const res = await fetchViaHTTP(next.url, '/')
expect(res.status).toBe(200)
Expand Down