From dce61a1706bf712ec19a521ebb91eadb4d462c00 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Mon, 23 Oct 2023 11:56:33 -0600 Subject: [PATCH] fix(react): Ensure require('nx') to resolve correctly --- .../module-federation-dev-server.impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts b/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts index 94d24da7819ae6..d58ae152dffd39 100644 --- a/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts +++ b/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts @@ -40,7 +40,8 @@ export default async function* moduleFederationDevServer( options: ModuleFederationDevServerOptions, context: ExecutorContext ): AsyncIterableIterator<{ success: boolean; baseUrl?: string }> { - const nxBin = require.resolve('nx'); + // Force Node to resolve to look for the nx binary that is inside node_modules + const nxBin = require.resolve('nx/'); const currIter = options.static ? fileServerExecutor( {