nx icon indicating copy to clipboard operation
nx copied to clipboard

Error: Cannot find project 'blog' on Core Nx Tutorial - Step 1

Open mbriantoc opened this issue 3 years ago • 9 comments

Documentation issue

  • [ ] Reporting a typo
  • [x] Reporting a documentation bug
  • [ ] Documentation improvement
  • [ ] Documentation feedback

Is there a specific documentation page you are reporting?

https://nx.dev/core-tutorial/01-create-blog

Additional context or description

After following all the steps in the page, the build and serve commands both fail with Cannot find project 'blog' is there any step missing?

I tried adding { "blog": "packages/blog"} to the projects property of workspace.json but then I got different errors about missing files. So if that's the way, there's more missing configuration.

mbriantoc avatar Jul 07 '22 12:07 mbriantoc

Encountered the same issue. If you delete workspace.json it works as expected.

The docs state that: The workspace.json file in the root directory is optional. It's used if you want to list the projects in your workspace explicitly instead of Nx scanning the file tree for all project.json and package.json files..

It seems that either the tutorial should be updated to mention adding 'blog' to workspace.json or generating shouldn't create that file by default.

joncarlson avatar Jul 08 '22 20:07 joncarlson

The npm preset shouldn't create a workspace.json file, hence the assumption that project inference would be active. Can you confirm npx create-nx-workspace@latest --preset npm is creating a workspace.json file?

AgentEnder avatar Jul 08 '22 22:07 AgentEnder

Yes, I just copy/pasted that command and there is a workspace.json in the created project.

joncarlson avatar Jul 11 '22 15:07 joncarlson

I can also verify I am having the same result.

jshinevar avatar Aug 26 '22 13:08 jshinevar

Same issue here.

rascode avatar Aug 29 '22 17:08 rascode

The npm preset shouldn't create a workspace.json file, hence the assumption that project inference would be active. Can you confirm npx create-nx-workspace@latest --preset npm is creating a workspace.json file?

yeap this command create the workpkace.json. Should tell in the tutorial to remove it or not create it in the first place.

Thanks

pikooli avatar Sep 02 '22 06:09 pikooli

Same issue in trying the tutorial.

johnstew avatar Sep 07 '22 14:09 johnstew

Also encountered the same issue.

npalmer-zs avatar Sep 16 '22 20:09 npalmer-zs

I had the same issue. After deleting the workspace.json file, the commands started working

rafacteixeira avatar Sep 19 '22 08:09 rafacteixeira

https://nx.dev/getting-started/package-based-repo-tutorial#getting-started-with-package-based-repos

this guide does not work

I have error "NX : Cannot find project 'is-even'"

medmin avatar Oct 21 '22 03:10 medmin

@medmin see: https://github.com/nrwl/nx/issues/12689

AgentEnder avatar Oct 21 '22 03:10 AgentEnder

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[bot] avatar Mar 21 '23 16:03 github-actions[bot]