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

Unable to run 'npx nx@15.8.0-beta.2 g @angular/fire:ng-add' due to SynchronousDelegateExpectedException #15167

Closed
kegbuna opened this issue Feb 22, 2023 · 3 comments

Comments

@kegbuna
Copy link

kegbuna commented Feb 22, 2023

Current Behavior

When attempting to add @angular/fire to a project, I am able to go through the feature selection process but after confirming everything, I run into an error.
image

Expected Behavior

The @angular/fire module to be successfully added to the project with selected features.

GitHub Repo

https://github.com/kegbuna/nx-angular-fire

Steps to Reproduce

  1. Create an angular app using ng new nx-angular-fire
  2. Convert the app to NX monorepo using npm nx@latest init
  3. Try to add angular file using npm install @angular/fire && npx nx g @angular/fire:ng-add

Nx Report

Node : 16.17.1
   OS   : win32 x64
   npm  : 9.5.0

   nx               : 15.7.2
   @nrwl/jest       : 15.7.2
   @nrwl/linter     : 15.7.2
   @nrwl/workspace  : 15.7.2
   @nrwl/angular    : 15.7.2
   @nrwl/cli        : 15.7.2
   @nrwl/cypress    : 15.7.2
   @nrwl/devkit     : 15.7.2
   @nrwl/js         : 15.7.2
   @nrwl/tao        : 15.7.2
   @nrwl/webpack    : 15.7.2
   @nrwl/nx-cloud   : 15.0.0
   typescript       : 4.9.5

Failure Logs

SynchronousDelegateExpectedException [Error]: Expected a synchronous delegate but got an asynchronous one.
    at SyncDelegateHost._doSyncCall (F:\nx-angular-fire\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:39:19)
    at SyncDelegateHost.read (F:\nx-angular-fire\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:57:21)
    at LazyFileEntry._load (F:\nx-angular-fire\node_modules\@angular-devkit\schematics\src\tree\host-tree.js:252:80)
    at LazyFileEntry.get content [as content] (F:\nx-angular-fire\node_modules\@angular-devkit\schematics\src\tree\entry.js:34:55)
    at HostTree.read (F:\nx-angular-fire\node_modules\@angular-devkit\schematics\src\tree\host-tree.js:211:30)
    at getWorkspace (F:\nx-angular-fire\node_modules\@angular\fire\schematics\utils.js:23:39)
    at Object.getProject (F:\nx-angular-fire\node_modules\@angular\fire\schematics\utils.js:39:27)
    at F:\nx-angular-fire\node_modules\@angular\fire\schematics\setup\index.js:105:76
    at Generator.next (<anonymous>)
    at fulfilled (F:\nx-angular-fire\node_modules\@angular\fire\schematics\setup\index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

 >  NX   Expected a synchronous delegate but got an asynchronous one.

   Pass --verbose to see the stacktrace.

Additional Information

Just started using this tonight so unsure of other things I could try. I saw in another thread that a new version may have a fix so I tried with nx@15.8.0-beta.2 but no luck

@leosvelperez
Copy link
Member

Thanks for reporting this!

That issue was fixed in #15137. I migrated the repo you provided to 15.8.0-beta.2 and the generation works as expected. I'm unsure how you tried with that version, make sure in that repo you run:

nx migrate next && npm i

After that, running the generation worked for me. If you still have issues, please update your repro using 15.8.0-beta.2 where I can reproduce the issue and I'll have a look.

@kegbuna
Copy link
Author

kegbuna commented Feb 22, 2023

Got it, I just tried to run the install with the version set via @. I will give this a go, thanks!

@github-actions
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 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants