nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.64k stars 2.36k forks source link

support for ng cache #10682

Closed markgoho closed 2 years ago

markgoho commented 2 years ago

Current Behavior

trying to work with ng cache appears totally broken

Expected Behavior

https://angular.io/cli/cache these commands should work

Steps to Reproduce

try to run npx ng cache see errors

Failure Logs

Error: Cannot find configuration for task dashboard:cache
    at getExecutorNameForTask (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/utils.js:155:15)
    at getExecutorForTask (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/utils.js:161:22)
    at getCustomHasher (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/utils.js:168:25)
    at TasksSchedule.<anonymous> (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/tasks-schedule.js:111:62)
    at Generator.next (<anonymous>)
    at /workspaces/active-branch-tracker/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/workspaces/active-branch-tracker/node_modules/tslib/tslib.js:114:16)
    at TasksSchedule.hashTask (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/tasks-schedule.js:110:24)
    at TasksSchedule.<anonymous> (/workspaces/active-branch-tracker/node_modules/nx/src/tasks-runner/tasks-schedule.js:59:24)

Environment

@markgoho ➜ /workspaces/active-branch-tracker (trunk ✗) $ npx nx report

 >  NX   Report complete - copy this into the issue template

   Node : 14.19.1
   OS   : linux x64
   npm  : 6.14.16

   nx : 14.2.4
   @nrwl/angular : 14.2.4
   @nrwl/cypress : 14.2.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.2.4
   @nrwl/eslint-plugin-nx : 14.2.4
   @nrwl/express : Not Found
   @nrwl/jest : 14.2.4
   @nrwl/js : Not Found
   @nrwl/linter : 14.2.4
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.0.8
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.2.4
   @nrwl/web : Not Found
   @nrwl/workspace : 14.2.4
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:
         @ngrx/component-store: 13.2.0
         @ngrx/effects: 13.2.0
         @ngrx/entity: 13.2.0
         @ngrx/router-store: 13.2.0
         @ngrx/store: 13.2.0
         @ngrx/schematics: 13.2.0
         @ngrx/store-devtools: 13.2.0

I believe this issue may be related to #10646

AgentEnder commented 2 years ago

Hey there! Compatibility with angular cli's cache is working as expected for Nx, the cache cli commands on the other hand will not work. This is a side-effect of Nx being the CLI that is ran, not angular cli.

That being said, you can still specify cache options through the cli object as described here: https://angular.io/guide/workspace-config#cache-options

As a note, the cli object lives in nx.json instead of angular.json or workspace.json when using Nx.

I'm going to close this out since it is working how we would expect, but if you feel it should be reopened feel free to leave a message and we can do so.

github-actions[bot] commented 1 year ago

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.