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