Skip to content

fix(js): resolve build output dir from globbed outputs in node executor#35288

Open
leosvelperez wants to merge 1 commit intomasterfrom
gh-35198
Open

fix(js): resolve build output dir from globbed outputs in node executor#35288
leosvelperez wants to merge 1 commit intomasterfrom
gh-35198

Conversation

@leosvelperez
Copy link
Copy Markdown
Member

Current Behavior

The @nx/js:node executor fails with Could not find <project>/dist/**/*.{js,cjs,mjs,jsx,d.ts,d.cts,d.mts}{,.map}/main.js. Make sure your build succeeded. when combined with the inferred @nx/js/typescript build target.

Since #35041 narrowed the inferred build target's outputs[0] from {projectRoot}/dist to {projectRoot}/dist/**/*.{js,...}{,.map} (to prevent cross-OS cache pollution), the node executor's getFileToRun kept joining main.js onto that value and produced an invalid path.

Expected Behavior

outputs entries are cache patterns and may legitimately contain globs. getFileToRun now strips the glob portion back to the last path separator before appending main.js, so <projectRoot>/dist/**/*.{js,...}{,.map} correctly resolves to <projectRoot>/dist/main.js. Handles **, *, ?, character classes, brace expansion, extglob, and Windows/POSIX separators.

Related Issue(s)

Fixes #35198

@leosvelperez leosvelperez requested a review from a team as a code owner April 14, 2026 13:04
@leosvelperez leosvelperez self-assigned this Apr 14, 2026
@leosvelperez leosvelperez requested a review from lourw April 14, 2026 13:04
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit e97708f
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69de3b4a6385c00008544719
😎 Deploy Preview https://deploy-preview-35288--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.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit e97708f
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69de3b4ad15849000865a5f6
😎 Deploy Preview https://deploy-preview-35288--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.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Apr 14, 2026

View your CI Pipeline Execution ↗ for commit e97708f

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 51m 13s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s 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-14 13:59:42 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@nx/js:node executor is broken since 22.6.4

1 participant