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

Fatal messages running Nx commands after upgrade to v8.12 #2404

Closed
demisx opened this issue Jan 30, 2020 · 11 comments
Closed

Fatal messages running Nx commands after upgrade to v8.12 #2404

demisx opened this issue Jan 30, 2020 · 11 comments

Comments

@demisx
Copy link

demisx commented Jan 30, 2020

Expected Behavior

No errors messages running Nx commands

Current Behavior

After upgrade to Nx 8.12 following https://nx.dev/angular/guides/update I am seeing a bunch of fatal messages similar to below after running Nx related commands, though the commands seem to work OK so far:

$ npm run affected:dep-graph
> nx affected:dep-graph

fatal: Path 'dl/package.json' exists, but not 'package.json'.
Did you mean 'master:dl/package.json' aka 'master:./package.json'?
fatal: Path 'dl/angular.json' exists, but not 'angular.json'.
Did you mean 'master:dl/angular.json' aka 'master:./angular.json'?
fatal: Path 'dl/package.json' exists, but not 'package.json'.
Did you mean 'master:dl/package.json' aka 'master:./package.json'?
fatal: Path 'dl/nx.json' exists, but not 'nx.json'.
Did you mean 'master:dl/nx.json' aka 'master:./nx.json'?
fatal: Path 'dl/nx.json' exists, but not 'nx.json'.
Did you mean 'master:dl/nx.json' aka 'master:./nx.json'?
fatal: Path 'dl/angular.json' exists, but not 'angular.json'.
Did you mean 'master:dl/angular.json' aka 'master:./angular.json'?
$ npx nx report
  @nrwl/angular : 8.12.0
  @nrwl/cli : 8.12.0
  @nrwl/cypress : 8.12.0
  @nrwl/eslint-plugin-nx : 8.12.0
  @nrwl/express : Not Found
  @nrwl/jest : 8.12.0
  @nrwl/linter : 8.12.0
  @nrwl/nest : 8.12.0
  @nrwl/next : Not Found
  @nrwl/node : 8.12.0
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 8.12.0
  @nrwl/web : Not Found
  @nrwl/workspace : 8.12.0
  typescript : 3.5.3
@FrozenPandaz
Copy link
Collaborator

Can you please provide a repo showcasing the issue to help us debug this issue?

@luejerry
Copy link

luejerry commented Feb 8, 2020

Getting the same issue. Might it be because our Nx workspace root is not the git repo root? Will try to set up a repro.

@demisx
Copy link
Author

demisx commented Feb 28, 2020

Sorry, I haven't had a chance to work on the reproduction repo due to my current deadlines. However, I am no longer getting these error messages after upgrading Nx to v9.0.4.

@demisx demisx closed this as completed Feb 28, 2020
@demisx
Copy link
Author

demisx commented Mar 4, 2020

I was wrong closing this issue prematurely. I still see the same messages in v9.0.4 running npx nx affected:dep-graph or seems like npx nx affected:... anything for that matter. I've just replicated it with a brand new Nx workspace:

npx create-nx-workspace dl --preset=empty --cli=angular
cd dl
npm install --save-dev @nrwl/angular
npm install --save-dev @nrwl/nest
npm install --save-dev @nrwl/node
npx ng g @nrwl/angular:app web --directory --tags=scope:web,type:app (SASS, no routing)
npx ng g @nrwl/nest:app api --directory --tags=scope:api,type:app
npx ng g @nrwl/nest:app api-e2e --directory  --tags=scope:api-e2e,type:app
npx ng g @nrwl/node:lib util-test --directory shared --tags=scope:shared,type:util --linter eslint
npx nx affected:build
fatal: Path 'dl/package.json' exists, but not 'package.json'.
Did you mean 'master:dl/package.json' aka 'master:./package.json'?
fatal: Path 'dl/angular.json' exists, but not 'angular.json'.
Did you mean 'master:dl/angular.json' aka 'master:./angular.json'?
fatal: Path 'dl/nx.json' exists, but not 'nx.json'.
Did you mean 'master:dl/nx.json' aka 'master:./nx.json'?
fatal: Path 'dl/package.json' exists, but not 'package.json'.
Did you mean 'master:dl/package.json' aka 'master:./package.json'?
fatal: Path 'dl/tsconfig.json' exists, but not 'tsconfig.json'.
Did you mean 'master:dl/tsconfig.json' aka 'master:./tsconfig.json'?
fatal: Path 'dl/nx.json' exists, but not 'nx.json'.
Did you mean 'master:dl/nx.json' aka 'master:./nx.json'?
fatal: Path 'dl/angular.json' exists, but not 'angular.json'.
Did you mean 'master:dl/angular.json' aka 'master:./angular.json'?
...

This is my env:

npx nx report

>  NX  Report complete - copy this into the issue template

  @nrwl/angular : 9.0.4
  @nrwl/cli : 9.0.4
  @nrwl/cypress : 9.0.4
  @nrwl/eslint-plugin-nx : 9.0.4
  @nrwl/express : Not Found
  @nrwl/jest : 9.0.4
  @nrwl/linter : 9.0.4
  @nrwl/nest : 9.0.4
  @nrwl/next : Not Found
  @nrwl/node : 9.0.4
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.0.4
  @nrwl/web : Not Found
  @nrwl/workspace : 9.0.4
  typescript : 3.7.5

@demisx demisx reopened this Mar 4, 2020
@vsavkin
Copy link
Member

vsavkin commented Mar 4, 2020

@demisx could you push the repo with a repro to github?

@demisx
Copy link
Author

demisx commented Mar 4, 2020

@vsavkin Sure. Here it is. I've created the repo using commands in my previous comment and was able to see those errors . https://github.com/demisx/2404-nx-fatal-messages. Please note you'd have to be on the fatal-errors branch to see those errors printed:

git clone git@github.com:demisx/2404-nx-fatal-messages.git
cd 2404-nx-fatal-messages
git checkout fatal-errors
cd dl
npm install
npx nx affected:build

@ctaepper
Copy link

ctaepper commented Mar 5, 2020

I can add something here:

these fatal notes only appear if the file has changes... e.g. I make changes in
angular.json, then when I run nx affected --target=lint --base=master --head=HEAD

more importantly - the OP didn't mention this in his post - this kills the purpose of the affected command as is prevents nx to do porper affected comparison and just runs the command in all projects

fatal: Path 'ui/angular.json' exists, but not 'angular.json'.
Did you mean 'master:ui/angular.json' aka 'master:./angular.json'?

(also having the nx workspace in a subfolder of the repository root)

PS:

➜  ui git:(8e899fe65) nx report 

>  NX  Report complete - copy this into the issue template

  @nrwl/angular : 8.12.9
  @nrwl/cli : 8.12.9
  @nrwl/cypress : 8.12.9
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : 8.12.9
  @nrwl/jest : 8.12.9
  @nrwl/linter : 8.12.9
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 8.12.9
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 8.12.9
  @nrwl/web : Not Found
  @nrwl/workspace : 8.12.9
  typescript : 3.4.5

@ctaepper
Copy link

@vsavkin with the fix in #2537 the fatal messages are gone, but the problem remains that nx affected is not working anymore. as soon as I edit angular.json or package.json nx affected tells me that all libs and all apps are affected. I assume, this is not intended?

@demisx
Copy link
Author

demisx commented Mar 16, 2020

@ctaepper Both, angular.json and package.json have implicit dependencies defined in nx.json as "*". Thus, changing one of them will cause everything to be rebuilt. That's one of the drawbacks of the current NX monorepo right now as changes to those files occur quite often.

@ctaepper
Copy link

ok this makes sense. but I guess you can close your ticket then, because it is fixed

@demisx demisx closed this as completed Mar 16, 2020
@github-actions
Copy link

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 Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants