@@ -30,7 +30,7 @@ echo "Running integration tests on Node $NODE_VERSION"
30
30
# make a backup of our config file so we can restore it when we're done
31
31
mv next.config.js next.config.js.bak
32
32
33
- for NEXTJS_VERSION in 10 11 12; do
33
+ for NEXTJS_VERSION in 10 11 12 13 ; do
34
34
35
35
# export this to the env so that we can behave differently depending on which version of next we're testing, without
36
36
# having to pass this value from function to function to function to the one spot, deep in some callstack, where we
@@ -44,8 +44,14 @@ for NEXTJS_VERSION in 10 11 12; do
44
44
fi
45
45
46
46
# Next.js v11 requires at least Node v12
47
- if [ " $NODE_MAJOR " -lt " 12" ] && [ " $NEXTJS_VERSION " -eq " 11" ]; then
48
- echo " [nextjs$NEXTJS_VERSION ] Not compatible with Node $NODE_MAJOR "
47
+ if [ " $NODE_MAJOR " -lt " 12" ] && [ " $NEXTJS_VERSION " -ge " 11" ]; then
48
+ echo " [nextjs@$NEXTJS_VERSION ] Not compatible with Node $NODE_MAJOR "
49
+ exit 0
50
+ fi
51
+
52
+ # Next.js v13 requires at least Node v14
53
+ if [ " $NODE_MAJOR " -lt " 14" ] && [ " $NEXTJS_VERSION " -ge " 13" ]; then
54
+ echo " [nextjs@$NEXTJS_VERSION ] Not compatible with Node $NODE_MAJOR "
49
55
exit 0
50
56
fi
51
57
@@ -61,6 +67,11 @@ for NEXTJS_VERSION in 10 11 12; do
61
67
else
62
68
sed -i /" next.*latest" /s/latest/" ${NEXTJS_VERSION} .x" / package.json
63
69
fi
70
+
71
+ # Next.js v13 requires React 18.2.0
72
+ if [ " $NEXTJS_VERSION " -eq " 13" ]; then
73
+ npm i --save react@18.2.0 react-dom@18.2.0
74
+ fi
64
75
# We have to use `--ignore-engines` because sucrase claims to need Node 12, even though tests pass just fine on Node
65
76
# 10
66
77
yarn --no-lockfile --ignore-engines --silent > /dev/null 2>&1
@@ -84,11 +95,11 @@ for NEXTJS_VERSION in 10 11 12; do
84
95
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
85
96
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
86
97
if [ " $NODE_MAJOR " -gt " 17" ] && [ " $WEBPACK_VERSION " -eq " 4" ]; then
87
- echo " [nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
98
+ echo " [nextjs@ $NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
88
99
exit 0
89
100
fi
90
101
if [ " $NODE_MAJOR " -gt " 17" ] && [ " $NEXTJS_VERSION " -eq " 10" ]; then
91
- echo " [nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
102
+ echo " [nextjs@ $NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
92
103
exit 0
93
104
fi
94
105
0 commit comments