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

Removed library still affects NX repo #16091

Closed
jaqua opened this issue Apr 4, 2023 · 8 comments · Fixed by #16210
Closed

Removed library still affects NX repo #16091

jaqua opened this issue Apr 4, 2023 · 8 comments · Fixed by #16210
Labels

Comments

@jaqua
Copy link

jaqua commented Apr 4, 2023

Current Behavior

I removed a library from the monorepo using nx console. The library and its folder is deleted and library is removed in tsconfig.base.json file. Everythin seems fine.

But running all tests gives me an error for the removed library:

  nx run project-data-access-new-case:test
   >  NX   Can't find a root directory while resolving a config file path.
   
      Provided path to resolve: /Users/source/libs/project/data-access-new-case/jest.config.ts
      cwd: /Users/source
      Pass --verbose to see the stacktrace.

Yes of course the jest.config.ts file is not existing, as it is removed. I don't understand why NX is looking for this library, although it shouldn't exist anymore.

Even the nx console remembers the library: If I want to remove another library, the autocomplete function still shows the removed library. Of course it fails to run the remove, as the files aren't existing anymore.

Expected Behavior

Removed library shouldn't affect NX in any way...

GitHub Repo

No response

Steps to Reproduce

Nx Report

Node : 18.12.1
   OS   : darwin arm64
   npm  : 8.19.2
   
   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/detox             : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/nest              : 15.9.2
   @nrwl/next              : 15.9.2
   @nrwl/node              : 15.9.2
   @nrwl/react             : 15.9.2
   @nrwl/react-native      : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   typescript              : 4.9.5

Failure Logs

No response

Additional Information

No response

@jaqua jaqua added the type: bug label Apr 4, 2023
@geraparra
Copy link

I'm facing the same issue here with the same version, just waiting for info about it.

@AgentEnder AgentEnder added the scope: core core nx functionality label Apr 4, 2023
@jaqua
Copy link
Author

jaqua commented Apr 4, 2023

I would like to know how NX is calculating which apps/libs are affected by the command. For example nx run-many --all --target=test is also looking for the removed lib. Obviously NX is not using tsconfig file, nor is it looking for folders. So there have to be another place, where the info about the removed lib is persisting...

@PointSingularity
Copy link

PointSingularity commented Apr 5, 2023

I had a similar problem, but using nx reset fixed it, by clearing the cache.

@jaqua
Copy link
Author

jaqua commented Apr 5, 2023

@PointSingularity You are right. That helped. Thanks for that.

@jaqua jaqua closed this as completed Apr 5, 2023
@PointSingularity
Copy link

@jaqua I think this wasn't the case in previous versions of NX. You didn't have to use nx reset. So this might be a bug, maybe it should stay open.

@jaqua jaqua reopened this Apr 5, 2023
@meeroslav
Copy link
Contributor

Please keep this open until we investigate it.

Possibly related to #15964

@the-ult
Copy link

the-ult commented Apr 14, 2023

Same thing is happening with linting.
Still get linting errors about removed/moved projects:

  • Removing ./cache folder and node_modules/.cache or even removing everything (.cache and node_modules) did not help.
  • npx nx reset does not work either
✖  nx run shared-info:lint
       Linting "shared-info"...
       
        >  NX   All files matching the following patterns are ignored:
       
          - 'libs/shared/info/src/**/*.ts'
          - 'libs/shared/info/src/**/*.html'
          
          Please check your '.eslintignore' file.
          Pass --verbose to see the stacktrace.
❯ npx nx report

 >  NX   Report complete - copy this into the issue template

   Node : 18.14.0
   OS   : darwin x64
   npm  : 9.3.1
   
   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/angular           : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @testing-library/angular : 13.4.0

@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 May 15, 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.

6 participants