Skip to content

fix(js): use explicit nx/bin/nx path in start-local-registry#35127

Merged
FrozenPandaz merged 1 commit into
masterfrom
fix/nx-resolve-and-e2e-fixes
Apr 1, 2026
Merged

fix(js): use explicit nx/bin/nx path in start-local-registry#35127
FrozenPandaz merged 1 commit into
masterfrom
fix/nx-resolve-and-e2e-fixes

Conversation

@jaysoo

@jaysoo jaysoo commented Apr 1, 2026

Copy link
Copy Markdown
Member

Current Behavior

start-local-registry.ts uses require.resolve('nx') to find the nx CLI binary for forking a child process. This resolves the package's main entry point, which only incidentally points to the binary. In pnpm strict mode, this resolution fails when called from within @nx/js because @nx/js doesn't declare nx as a direct dependency.

Expected Behavior

Use require.resolve('nx/bin/nx') to explicitly resolve the CLI binary entry point. This is semantically correct (the intent is to fork the nx CLI) and doesn't rely on the main field or pnpm hoisting behavior.

## Current Behavior

`start-local-registry.ts` uses `require.resolve('nx')` to find the nx
CLI binary for forking a child process. This resolves the package's
`main` entry point, which only incidentally points to the binary.
In pnpm strict mode, this resolution fails when called from within
`@nx/js` because `@nx/js` doesn't declare `nx` as a direct dependency.

## Expected Behavior

Use `require.resolve('nx/bin/nx')` to explicitly resolve the CLI binary
entry point. This is semantically correct (the intent is to fork the nx
CLI) and doesn't rely on the `main` field or pnpm hoisting behavior.
@jaysoo jaysoo requested a review from a team as a code owner April 1, 2026 15:26
@jaysoo jaysoo requested a review from MaxKless April 1, 2026 15:26
@netlify

netlify Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 4f51808
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69cd39244f773600080bb09c
😎 Deploy Preview https://deploy-preview-35127--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 4f51808
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69cd39241a2f2f00080c7cb5
😎 Deploy Preview https://deploy-preview-35127--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 4f51808

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 56m 14s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 6s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-01 16:27:22 UTC

@FrozenPandaz FrozenPandaz enabled auto-merge (squash) April 1, 2026 16:21
@FrozenPandaz FrozenPandaz merged commit 49a0e3f into master Apr 1, 2026
24 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/nx-resolve-and-e2e-fixes branch April 1, 2026 16:27
FrozenPandaz pushed a commit that referenced this pull request Apr 1, 2026
## Current Behavior

`start-local-registry.ts` uses `require.resolve('nx')` to find the nx
CLI binary for forking a child process. This resolves the package's
`main` entry point, which only incidentally points to the binary. In
pnpm strict mode, this resolution fails when called from within `@nx/js`
because `@nx/js` doesn't declare `nx` as a direct dependency.

## Expected Behavior

Use `require.resolve('nx/bin/nx')` to explicitly resolve the CLI binary
entry point. This is semantically correct (the intent is to fork the nx
CLI) and doesn't rely on the `main` field or pnpm hoisting behavior.

(cherry picked from commit 49a0e3f)
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants