From cec607bb5d7edf6c685eb766e6727617155936b3 Mon Sep 17 00:00:00 2001 From: Thomas Blanchard Date: Mon, 7 Nov 2022 16:13:21 +0100 Subject: [PATCH] fix(nextjs): error in with-nx.ts (#12973) --- packages/next/plugins/with-nx.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/next/plugins/with-nx.ts b/packages/next/plugins/with-nx.ts index 7fe8d70265006..135b4db94bc4c 100644 --- a/packages/next/plugins/with-nx.ts +++ b/packages/next/plugins/with-nx.ts @@ -79,7 +79,7 @@ export function withNx( rule.sideEffects === false && regexEqual(rule.test, /\.module\.css$/) ); // Might not be found if Next.js webpack config changes in the future - if (nextCssLoader) { + if (nextCssLoader && nextCssLoader.issuer) { nextCssLoader.issuer.or = nextCssLoader.issuer.and ? nextCssLoader.issuer.and.concat(includes) : includes; @@ -95,7 +95,7 @@ export function withNx( regexEqual(rule.test, /\.module\.(scss|sass)$/) ); // Might not be found if Next.js webpack config changes in the future - if (nextSassLoader) { + if (nextSassLoader && nextSassLoader.issuer) { nextSassLoader.issuer.or = nextSassLoader.issuer.and ? nextSassLoader.issuer.and.concat(includes) : includes; @@ -130,7 +130,7 @@ export function withNx( ) ); // Might not be found if Next.js webpack config changes in the future - if (nextGlobalCssLoader) { + if (nextGlobalCssLoader && nextGlobalCssLoader.issuer) { nextGlobalCssLoader.issuer.or = nextGlobalCssLoader.issuer.and ? nextGlobalCssLoader.issuer.and.concat(includes) : includes;