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

Application suddenly does not build and throws ERROR: No cached ProjectGraph is available. #21244

Closed
1 of 4 tasks
leonandroid opened this issue Jan 19, 2024 · 3 comments
Closed
1 of 4 tasks
Labels

Comments

@leonandroid
Copy link

Current Behavior

Executing task: npx nx run r-trainings:build
(Using the NX Console extension (v18.13.0) in visual studio Code)


**Could not find 'nx' module in this workspace. Error: [readCachedProjectGraph] ERROR: No cached ProjectGraph is available.**

If you are leveraging \`readCachedProjectGraph()\` directly then you will need to refactor your usage to first ensure that
the ProjectGraph is created by calling \`await createProjectGraphAsync()\` somewhere before attempting to read the data.

If you encounter this error as part of running standard \`nx\` commands then please open an issue on https://github.com/nrwl/nx
    at readCachedProjectGraph (C:\GIT\xxx\node_modules\nx\src\project-graph\project-graph.js:30:15)
    at run (C:\GIT\xxx\node_modules\nx\src\command-line\run\run.js:151:69)
    at process.<anonymous> (C:\GIT\xxx\node_modules\nx\bin\run-executor.js:59:48)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 

 >  NX   Ran target build for project r-trainings (409ms)

    ×    1/1 failed
    √    0/1 succeeded [0 read from cache]

Expected Behavior

Run build without issues.
This application was working fine, without making any change the app suddenly does not build anymore.

The only difference between today and other day, was that I executed the build with specifically configuration to be "Production" and to "clean nx cache". And since then, nothing works.

I have a second application using NX as well, but with a lower version of angular. This application does not fail.
The application having the issue is a very small app used as POC, has zero strange dependencies except for NX and Angular Material.

GitHub Repo

No response

Steps to Reproduce

1.Perhaps just upgrade to latest nx console plugin

Nx Report

Node   : 18.17.0
   OS     : win32-x64
   npm    : 9.6.7
   
   nx (global)        : 17.2.8
   nx                 : 16.10.0
   @nx/js             : 16.10.0
   @nx/jest           : 16.10.0
   @nx/linter         : 16.10.0
   @nx/workspace      : 16.10.0
   @nx/angular        : 16.10.0
   @nx/cypress        : 16.10.0
   @nx/devkit         : 16.10.0
   @nx/eslint-plugin  : 16.10.0
   @nrwl/tao          : 16.10.0
   @nx/web            : 16.10.0
   @nx/webpack        : 16.10.0
   typescript         : 5.1.6

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the blocked: retry with latest Retry with latest release or head. label Jan 28, 2024
@AgentEnder
Copy link
Member

Can you try updating Nx via nx migrate?

@AgentEnder AgentEnder added the scope: misc Misc issues label Jan 28, 2024
Copy link

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.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

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

No branches or pull requests

2 participants