@@ -91,16 +91,24 @@ for NEXTJS_VERSION in 10 11 12 13; do
9191 WEBPACK_VERSION=5 ||
9292 WEBPACK_VERSION=4
9393
94- # Node v18 only with Webpack 5 and above
95- # https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
96- # Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
97- if [ " $NODE_MAJOR " -gt " 17" ] && [ " $WEBPACK_VERSION " -eq " 4" ]; then
98- echo " [nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
99- exit 0
100- fi
101- if [ " $NODE_MAJOR " -gt " 17" ] && [ " $NEXTJS_VERSION " -eq " 10" ]; then
102- echo " [nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
103- exit 0
94+ if [ " $NODE_MAJOR " -gt " 17" ]; then
95+ # Node v17+ does not work with NextJS 10 and 11 because of their legacy openssl use
96+ # Ref: https://github.com/vercel/next.js/issues/30078
97+ if [ " $NEXTJS_VERSION " -lt " 12" ]; then
98+ echo " [nextjs@$NEXTJS_VERSION Node $NODE_MAJOR not compatible with NextJS $NEXTJS_VERSION "
99+ # Continues the 2nd enclosing loop, which is the outer loop that iterates over the NextJS version
100+ continue 2
101+ fi
102+
103+ # Node v18 only with Webpack 5 and above
104+ # https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
105+ # Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
106+ if [ " $WEBPACK_VERSION " -eq " 4" ]; then
107+ echo " [nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION ] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION "
108+ # Continues the 1st enclosing loop, which is the inner loop that iterates over the Webpack version
109+ continue
110+ fi
111+
104112 fi
105113
106114 # next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
0 commit comments