Skip to content

Commit 3e6b0ee

Browse files
committed
Revisit exit / continue logic for Node versions 17+.
1 parent 3e3a84d commit 3e6b0ee

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

packages/nextjs/test/integration/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@sentry/nextjs": "file:../../",
14-
"next": "latest",
14+
"next": "10.x",
1515
"react": "^17.0.1",
1616
"react-dom": "^17.0.1"
1717
},
@@ -24,6 +24,7 @@
2424
"yargs": "^16.2.0"
2525
},
2626
"resolutions": {
27+
"next": "./node_modules/next/dist",
2728
"@sentry/browser": "file:../../../browser",
2829
"@sentry/core": "file:../../../core",
2930
"@sentry/integrations": "file:../../../integrations",

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)