Skip to content

Commit 7d4922a

Browse files
committed
feat(ci): Add Node 18 to test matrix
1 parent 0a6b4f2 commit 7d4922a

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ jobs:
245245
runs-on: ubuntu-latest
246246
strategy:
247247
matrix:
248-
node: [8, 10, 12, 14, 16]
248+
node: [8, 10, 12, 14, 16, 18]
249249
steps:
250250
- name: Check out current commit (${{ env.HEAD_COMMIT }})
251251
uses: actions/checkout@v2
@@ -282,7 +282,7 @@ jobs:
282282
runs-on: ubuntu-latest
283283
strategy:
284284
matrix:
285-
node: [10, 12, 14, 16]
285+
node: [10, 12, 14, 16, 18]
286286
steps:
287287
- name: Check out current commit (${{ env.HEAD_COMMIT }})
288288
uses: actions/checkout@v2
@@ -482,7 +482,7 @@ jobs:
482482
continue-on-error: true
483483
strategy:
484484
matrix:
485-
node: [10, 12, 14, 16]
485+
node: [10, 12, 14, 16, 18]
486486
steps:
487487
- name: Check out current commit (${{ github.sha }})
488488
uses: actions/checkout@v2

packages/nextjs/test/run-integration-tests.sh

+8
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ for NEXTJS_VERSION in 10 11 12; do
7878
WEBPACK_VERSION=5 ||
7979
WEBPACK_VERSION=4
8080

81+
# Node v18 only with Webpack 5 and above
82+
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
83+
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
84+
if [ "$NODE_MAJOR" -gt "17" ] && [ "$WEBPACK_VERSION" -eq "4" ]; then
85+
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
86+
exit 0
87+
fi
88+
8189
# next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
8290
if [ "$NEXTJS_VERSION" -eq "10" ]; then
8391
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next10.config.template >next.config.js

packages/node/test/manual/webpack-domain/npm-build.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ const path = require('path');
22
const webpack = require('webpack');
33
const { execSync } = require('child_process');
44

5+
// Webpack test does not work in Node 18 and above.
6+
if (Number(process.versions.node.split('.')[0]) >= 18) {
7+
return;
8+
}
9+
510
// prettier-ignore
611
webpack(
712
{
@@ -13,7 +18,7 @@ webpack(
1318
target: 'node',
1419
mode: 'development',
1520
},
16-
function(err, stats) {
21+
function (err, stats) {
1722
if (err) {
1823
console.error(err.stack || err);
1924
if (err.details) {

0 commit comments

Comments
 (0)