Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined targets block in getOutputsForTargetAndConfiguration #19043

Closed
1 of 4 tasks
coffeeispower opened this issue Sep 6, 2023 · 2 comments · Fixed by #19057
Closed
1 of 4 tasks

Undefined targets block in getOutputsForTargetAndConfiguration #19043

coffeeispower opened this issue Sep 6, 2023 · 2 comments · Fixed by #19057
Assignees
Labels

Comments

@coffeeispower
Copy link

coffeeispower commented Sep 6, 2023

Current Behavior

I setup a simple monorepo with NX with a NAPI rust crate and 3 javascript modules. Everything's fine until I build the rust crate as a dependency of the CLI package.

Expected Behavior

It should build minui and the cli and run the Minepress CLI successfully

GitHub Repo

https://github.com/Mineqress/minepress

Steps to Reproduce

  1. Clone the minepress repository
  2. Checkout commit db73a5804cbcef3010e777e0a20ab20827aad16a
  3. Run nx execute cli

Nx Report

Node   : 18.16.1
   OS     : linux-x64
   pnpm   : 8.5.1
   
   nx                 : 16.7.4
   @nx/js             : 16.7.4
   @nx/jest           : 16.7.4
   @nx/linter         : 16.7.4
   @nx/workspace      : 16.7.4
   @nx/devkit         : 16.4.1
   @nx/esbuild        : 16.7.4
   @nx/eslint-plugin  : 16.7.4
   @nx/node           : 16.7.4
   @nrwl/tao          : 16.7.4
   typescript         : 5.1.3
   ---------------------------------------
   Community plugins:
   @monodon/rust : 1.2.0
   ---------------------------------------
   The following packages should match the installed version of nx
     - @nx/devkit@16.4.1
     - @nrwl/devkit@16.4.1
   
   To fix this, run `nx migrate nx@16.7.4`

Failure Logs

❯ pnpm nx execute cli --verbose

 >  NX   Running target execute for project cli and 2 tasks it depends on:

 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

> nx run cli:build:production


 >  NX   Cannot read properties of undefined (reading 'build')


TypeError: Cannot read properties of undefined (reading 'build')
    at getOutputsForTargetAndConfiguration (/home/tiago/Mineqress/minepress/node_modules/.pnpm/nx@16.7.4/node_modules/nx/src/tasks-runner/utils.js:113:50)
    at /home/tiago/Mineqress/minepress/node_modules/.pnpm/@nx+js@16.7.4_@types+node@18.7.1_nx@16.7.4_typescript@5.1.3/node_modules/@nx/js/src/utils/package-json/update-package-json.js:73:82
    at Array.forEach (<anonymous>)
    at addMissingDependencies (/home/tiago/Mineqress/minepress/node_modules/.pnpm/@nx+js@16.7.4_@types+node@18.7.1_nx@16.7.4_typescript@5.1.3/node_modules/@nx/js/src/utils/package-json/update-package-json.js:54:18)
    at updatePackageJson (/home/tiago/Mineqress/minepress/node_modules/.pnpm/@nx+js@16.7.4_@types+node@18.7.1_nx@16.7.4_typescript@5.1.3/node_modules/@nx/js/src/utils/package-json/update-package-json.js:32:9)
    at /home/tiago/Mineqress/minepress/node_modules/.pnpm/@nx+js@16.7.4_@types+node@18.7.1_nx@16.7.4_typescript@5.1.3/node_modules/@nx/js/src/utils/package-json/index.js:28:57
    at Generator.next (<anonymous>)
    at /home/tiago/Mineqress/minepress/node_modules/.pnpm/tslib@2.3.0/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/home/tiago/Mineqress/minepress/node_modules/.pnpm/tslib@2.3.0/node_modules/tslib/tslib.js:113:16)

 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target execute for project cli and 2 tasks it depends on failed

   Failed tasks:
   
   - cli:build:production
   
   Hint: run the command with --verbose for more details.


╭─    ~/Mineqress/minepress  on   main ⇡1 !2 ?1 ─────────────────────────────────────────────────────────────────────────── 1 ✘  ▼  impure   at 23:22:47  ─╮
╰─   

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

If i add a console.log(node) I get this:

{
  type: 'cargo',
  name: 'cargo:napi',
  data: { packageName: 'napi', version: '2.13.3' }
}

I think the @monodon/rust plugin is trying to do something with the rust dependencies

Also if I make it default to a empty object it fixes the problem like in this PR: #19033

@AgentEnder
Copy link
Member

This is interesting - it looks like we are trying to read targets on an external node which should never happen. I'll look into this.

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants