@@ -91,16 +91,24 @@ for NEXTJS_VERSION in 10 11 12 13; do
91
91
WEBPACK_VERSION=5 ||
92
92
WEBPACK_VERSION=4
93
93
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
+
104
112
fi
105
113
106
114
# next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
0 commit comments