-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@nx/dependency-checks
fails to detect dependencies after upgrade to nx 18
#22247
Comments
So the lint rule is definitely able to find these dependencies here in the Nx repo. We'll need more information in order to help you resolve your issue. What version did you migrate from? |
So I think I had the same issue as @L-NiNo. Since removing With |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
can confirm. ive wasted an entire afternoon on this damn thing. this linting plugin has just suddenly decided all the deps in the plugins package.json arn't being used. they certainly are. ive redownloaded deps, reset nx a million which ways.
|
@binaryartifex what about your I used these options to disable the failing linting rules:
set them to |
that takes care of the linting but honestly kinda defeats the purpose of a build package linter in the first place. the build step however has suddenly decided not to work at all. workspace plugins never use to have their own package.json, which was great for simple executors, etc that you wanted within the scope of your own integrated monorepo. reference my concern above with the build executor not finding swc helpers at all, ffs, they are installed, they are in the package.json of the plugin, its never been an issue before...wtf? utilities in the libs external to the plugin all of a sudden cannot be imported. there's now what must be a static rootDir set somewhere that refuses to be overridden so i can't tell this bloody thing it can in fact, look outside the plugin for its imports....what was meant to be literally a swap out for a business logo has got me grinding into the night to fix yet another random nx issue....sigh |
Also worth noting, package-lock cannot be gitignored |
I'm using pnpm and cannot actually pinpoint when this rule stopped working but even though my library is buildable the rule does not detect dependencies used in my project. How does this rule even work in the first place? Maybe I'm missing something that broke this rule. |
This issue has been automatically marked as stale because no reproduction was provided within 7 days. |
Can confirm this is happening with me as well and it started after i added
NX Report:
For now, i have changed the rule to {
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "warn"
}
} |
This issue has been automatically marked as stale because no reproduction was provided within 7 days. |
I have the same issue here I confirm it has something to do with package manager used (I'm using
See my repo at https://github.com/tinesoft/nxrocks/ |
I also have issues with the Here is one of the repos where this happens but I have it in various. |
@beeman are there steps required to reproduce this? When I do a fresh clone of your repo, I get this lint feedback, which seems to be accurate:
|
Thanks for testing this @JamesHenry! Can you try switching to the |
@beeman you are using pnpm lockfile v9 which is not supported by the Nx version you are using. We merged support for it already and it will be available in the upcoming Nx 19.2. When I check out that branch and run pnpm install, my installed (supported) v8 version of pnpm rewrites the lock file automatically because it doesn't recognize it. Linting passes in this scenario: So in your case it is likely down to the unsupported lock file. The latest prerelease for 19.2 is currently being released, so I will try that on your branch once it is ready without any modifications to your lock file to compare. |
@beeman Confirmed, yours is down to the unsupported lock file only. 19.2 prereleases, such as |
Please can all others on this thread try updating to |
Thanks a lot for checking this out and suggesting the solution! I'll test the new version and confirm back here! |
Just updated to the latest beta and this fixes this issue in my repo! Thanks! 🙏 |
This issue has been automatically marked as stale because no reproduction was provided within 7 days. |
I still have issues with this, even on v19. Might have something to do with me using publishable libraries only in my project. |
Had the same issue when upgrading to 19.3.2, using npm. Was fixed by re-generating package-lock. |
This issue has been automatically marked as stale because no reproduction was provided within 7 days. |
Ran into this just now, on 19.5.6. Anyone else seeing this? |
@JamesHenry tried to enable this rule today and following getting weird errors: I also noticed that
which will result in empty npmDependencies collection within the rule as this will never be executed NOTE: we don't use source analyzer because legacy reasons
quick repro:
|
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. |
Current Behavior
I upgraded my workspace to nx 18. Linting passed before the upgrade, but after the upgrade
@nx/dependency-checks
started reporting all my dependencies as obsolete:Worthy to note: The dependencies on other libraries in the workspace is still detected, and visible in the project graph with
nx graph
.Expected Behavior
These dependencies were detected before, and are imported in the source code, and
analyzeSourceFiles
is enabled for@nx/js
, so I expect them to be detected like innx@17
GitHub Repo
No response
Steps to Reproduce
Not sure, it might be due to the history of my Nx workspace, willing to follow diagnostic instructions to figure out a reproducer.
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Using
"checkObsoleteDependencies": false
I can disable the removal of my existing dependencies for now.The text was updated successfully, but these errors were encountered: