NX Feature Create: Receiving 'NX Expected a synchronous delegate but got an asynchronous one.'

71 views Asked by At

Hello I am attempting to do a simple feature library generation using NX for angular

I use the UI, but the command it spits out is nx generate @ngrx/schematics:feature --name=form --project=reps-feature --no-interactive

This is the error I receive

SynchronousDelegateExpectedException [Error]: Expected a synchronous delegate but got an 
asynchronous one.
    at SyncDelegateHost._doSyncCall (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:39:19)
    at SyncDelegateHost.read (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:57:21)       
    at LazyFileEntry._load (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\schematics\src\tree\host-tree.js:252:80)        
    at get content [as content] (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\schematics\src\tree\entry.js:34:55)        
    at HostTree.read (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\schematics\src\tree\host-tree.js:211:30)
    at getWorkspace (C:\Users\user\Web Projects\saa-workspace\node_modules\@ngrx\schematics\schematics-core\utility\config.js:13:29)
    at getProject (C:\Users\user\Web Projects\saa-workspace\node_modules\@ngrx\schematics\schematics-core\utility\project.js:6:47)
    at getProjectPath (C:\Users\user\Web Projects\saa-workspace\node_modules\@ngrx\schematics\schematics-core\utility\project.js:19:19)
    at C:\Users\user\Web Projects\saa-workspace\node_modules\@ngrx\schematics\src\action\index.js:18:61
    at callRuleAsync (C:\Users\user\Web Projects\saa-workspace\node_modules\@angular-devkit\schematics\src\rules\call.js:78:24)

NX Expected a synchronous delegate but got an asynchronous one.

Nx Version:

  • Local: v15.7.2
  • Global: v15.9.2

Angular CLI: 15.2.4 Node: 18.12.1 Package Manager: npm 8.19.2 OS: win32 x64

Something weird to note is that going through a bunch of random hoops had it fixed temporarily a long time ago, but were retried and did not work again. Maybe it was unrelated.

1

There are 1 answers

0
Sam Alexander On BEST ANSWER

So generating a feature library isnt necessary, one can just generate a library and call it *-feature