Skip to content

Commit 248e4f7

Browse files
committed
Revisit exit / continue logic for Node versions 17+.
1 parent 8817c2f commit 248e4f7

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
@@ -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

Comments
 (0)