Skip to content

Commit b404968

Browse files
committed
fix: default to wrap the middleware if version cannot be determined
1 parent d27c584 commit b404968

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export function constructWebpackConfigFunction({
276276
});
277277

278278
// Wrap middleware
279-
const canWrapStandaloneMiddleware = userNextConfig.output !== 'standalone' || (major && major < 16);
279+
const canWrapStandaloneMiddleware = userNextConfig.output !== 'standalone' || !major || major < 16;
280280
if ((userSentryOptions.autoInstrumentMiddleware ?? true) && canWrapStandaloneMiddleware) {
281281
newConfig.module.rules.unshift({
282282
test: isMiddlewareResource,

0 commit comments

Comments
 (0)