Skip to content

Commit

Permalink
fix(nextjs): check validity of Nx context in withNx plugin (#13358)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 23, 2022
1 parent bcbff1e commit dc16468
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next/plugins/with-nx.ts
Expand Up @@ -38,6 +38,10 @@ export function withNx(
nextConfig = {} as WithNxOptions,
context: WithNxContext = getWithNxContext()
): NextConfig {
// If `next-compose-plugins` is used, the context argument is invalid.
if (!context.libsDir || !context.workspaceRoot) {
context = getWithNxContext();
}
const userWebpack = nextConfig.webpack || ((x) => x);
const { nx, ...validNextConfig } = nextConfig;
return {
Expand Down

0 comments on commit dc16468

Please sign in to comment.