question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing of nx args during build errors out

See original GitHub issue

I just upgraded my mono repo from lerna 4.0 to lerna 6.1.0.

I’m not sure where this issue is but based on the stacktrace it appears like the issue is when args are being parsed and transformed into NxArgs.

When I try to run a build I get the following error:

erna ERR! Error: No projects matching: e
lerna ERR!     at projectsToRun (C:\Projects\ePact\frontendMonoRepo\node_modules\nx\src\command-line\run-many.js:56:23)
lerna ERR!     at C:\Projects\ePact\frontendMonoRepo\node_modules\nx\src\command-line\run-many.js:24:26
lerna ERR!     at Generator.next (<anonymous>)
lerna ERR!     at fulfilled (C:\Projects\ePact\frontendMonoRepo\node_modules\tslib\tslib.js:114:62)
lerna ERR! lerna No projects matching: e
error Command failed with exit code 1.

And on further investigation, I updated the projectsToRun method in the run-many.js file, I found out when do a console.log of the nxArgs, it prints the following:

{
  projects: 'epact-dashboards-front-end,cico-portal-app,@epact/api,@epact/common,@epact/locales,@epact/theme,@epact/ui',
  outputStyle: 'dynamic',
  parallel: 12,
  nxBail: true,
  nxIgnoreCycles: true,
  skipNxCache: false,
  verbose: undefined,
  __overrides__: [],
  targets: [ 'build' ]
}

The above log indicates the projects are not being parsed into an array, which I think seems to be the issue here. When I hardcode the project names with the following, the build works: nxArgs.projects = ['epact-dashboards-front-end', 'cico-portal-app', '@epact/api', '@epact/common', '@epact/locales', '@epact/theme', '@epact/ui'];

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

3reactions
ykageyama-mondocommented, Dec 23, 2022

A workaround that’s working for me is to pin the version of nx to version 15.3.3

1reaction
JamesHenrycommented, Dec 23, 2022

Hi Folks, really sorry about this one, I have a PR up to fix it.

We will make sure we come up with a cross project testing strategy in the new year to ensure that these kinds of issues do not occur in future

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yargs processing mangles command line args passed into ...
FYI I am now doing this in my plugin to start working around the issue. It's a real pain :( // NX Mangles...
Read more >
Why am i getting error on using any `nx` commands
Just had this issue myself. Fixed it by deleting all my node_modules, verifying npm cache, updating my global @nrwl-cli, and reinstalling.
Read more >
Parcel
If you make an error in your code or configuration, Parcel displays beautiful diagnostics in your terminal and in the browser. Every error...
Read more >
Can you make a bash script's option arguments be optional?
When the default value is used, we need to restart option parsing at the point after the -a , which means shifting off...
Read more >
nrwl/nx - Orb - CircleCI
If last successful workflow run was not found, by default we report warning and fallback to HEAD~1. You can instead make this a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found