Open mdungmc opened 2 months ago
Same here. Since yesterday nx does not see any projects in nx workspaces anymore on my system. That also happens when I create an entirely new workspace usingnpx create-nx-workspace
to create a fresh workspace. It seems the graph does not yield any projects in the workspace.
Scaffolding a new project using npx nx g @nrwl/angular:application some-project
will add a project to the graph, which then shows up. However, if I delete the .nx folder in the workspace, that project is also never reflected on the graph again. It seems graph creation is broken.
I am on MacOS 15.
Node : 20.17.0 OS : darwin-arm64 Native Target : aarch64-macos yarn : 4.5.0
nx : 19.8.2 @nx/js : 19.8.2 @nx/jest : 19.8.2 @nx/linter : 19.8.2 @nx/eslint : 19.8.2 @nx/workspace : 19.8.2 @nx/angular : 19.8.2 @nx/devkit : 19.8.2 @nx/eslint-plugin : 19.8.2 @nrwl/tao : 19.8.2 @nx/web : 19.8.2 @nx/webpack : 19.8.2 typescript : 5.5.4
I tried to clone the project again, try to reinstall anything I can (Windows, npm, node, ...) but the problem have not repaired.
same here: removed node, npm, yarn, eventually volta entirely. removed homebrew entirely. remove any plugins for zsh. any nx workspace i have on the system, nx appears to yield an empty graph.
It does not matter what kind of project I create. react, angular all the same.
npx create-nx-workspace
% npx create-nx-workspace nx-test
NX Let's create a new workspace [https://nx.dev/getting-started/intro]
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · nextjs
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · nx-test
✔ Would you like to use the App Router (recommended)? · No
✔ Would you like to use the src/ directory? · Yes
✔ Test runner to use for end to end (E2E) tests · none
✔ Default stylesheet format · css
✔ Which CI provider would you like to use? · skip
✔ Would you like remote caching to make your build faster? · skip
NX Creating your v19.8.2 workspace.
✔ Installing dependencies with npm
✔ Successfully created the workspace: nx-test.
% nx show project nx-test
Could not find project nx-test
% cat .nx/workspace-data/project-graph.json
{
"nodes": {},
"externalNodes": {},
"dependencies": {},
"version": "6.0"
}
In my case the culprit was a .gitignore
file in a parent directory with a wildcard. That file is in my home directory, where I also have a projects directory. Apparently Nx considers a parent directory's .gitignore somehow. Anyways, for me this issue is resolved.
In my case the culprit was a
.gitignore
file in a parent directory with a wildcard. That file is in my home directory, where I also have a projects directory. Apparently Nx considers a parent directory's .gitignore somehow. Anyways, for me this issue is resolved.
As stated by @binarybro .gitignore
in my home dir was the problem because of the wildcard.
Workspace works after the following steps:
npx create-nx-workspace@latest
rm -rf .nx
!*
to .gitingoreIn my case the culprit was a
.gitignore
file in a parent directory with a wildcard. That file is in my home directory, where I also have a projects directory. Apparently Nx considers a parent directory's .gitignore somehow. Anyways, for me this issue is resolved.
Thanks so much! I hit the same issue.
I think this is a bug in nx
. I have my nx
workspace in a directory tree that somewhere along the ladder has a parent folder that was also a git repository ignoring all of its subfolders, nx
just mysteriously couldn't find any projects in the workspace.
nx
should probably stop looking for parent .gitignores
at the root of the repository / workspace?
This is the structure I had
/foo
/foo/.gitignore
/foo/bar
/foo/bar/pnpm-workspace.yml
/foo/bar/apps/
/foo/bar/apps/project-that-should-be-visible
# …
Both /foo
and /foo/bar
were git repositories. /foo/.gitignore
contained a single line with */
.
/foo/bar/pnpm-workspace.yml
looks like this:
packages:
- apps/*
/foo/bar
is the nx repository, and no projects could be found, even though all subfolders were visible to the git repository in /foo/bar
.
this is similar to https://github.com/nrwl/nx/issues/27368 reported few month ago, issue started from nx v19.5
Current Behavior
Anytime I run
npm start web
, i always got:Cannot find project 'web'
Expected Behavior
I just want to run the project
GitHub Repo
No response
Steps to Reproduce
Firstly I ran project successfully, but accidentally, the project is crashed like now.
Nx Report
Failure Logs
Package Manager Version
npm 20.15.1
Operating System
Additional Information
No response