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

Since removing angular.json, IntelliJ/Webstorm IDE no longer shows Angular schematics in menus. #29751

Open
2 of 4 tasks
lobo78 opened this issue Jan 24, 2025 · 2 comments
Open
2 of 4 tasks

Comments

@lobo78
Copy link

lobo78 commented Jan 24, 2025

Current Behavior

I support an Angular NX monorepo at a company where many developers use the Intellij IDE. Intellij can detect the presence of an Angular application and show Angular schematics in it's menu. However, this appears to depend on the presence of an angular.json file. However, NX removed the angular.json file in favor of project.json files in each app/lib, thus Intellij no longer recognizes it as an Angular app and thus no longer shows schematics in the menu. Is there a way to both use the latest NX and continue to have Angular schematics appear in Intellij?

Image

Image

Expected Behavior

Angular schematics to show in Intellij menu (see screenshots). The screenshots shows Intellij menus once Intellij recognizes an Angular app due to the presence of an angular.json file.

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest nx-example-workspace
  2. ✔ Which stack do you want to use? · angular
    ✔ Integrated monorepo, or standalone project? · integrated
    ✔ Application name · nx-example-workspace
    ✔ Which bundler would you like to use? · webpack
    ✔ Default stylesheet format · scss
    ✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? · No
    ✔ Test runner to use for end to end (E2E) tests · none
    ✔ Which CI provider would you like to use? · skip
    ✔ Would you like remote caching to make your build faster? · skip
  3. Open workspace in Intellij or Webstorm.
  4. Open File -> New (Notice there is no menu option for Angular Schematics or Angular Dependencies
  5. Right click on a Typescript file in the workspace, go to New (Notice there is no menu option for Angular Schematics or Angular Dependencies)

Nx Report

NX   Report complete - copy this into the issue template

Node           : 18.20.5
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.8.2

nx                     : 20.3.3
@nx/js                 : 20.3.3
@nx/jest               : 20.3.3
@nx/eslint             : 20.3.3
@nx/workspace          : 20.3.3
@nx/angular            : 20.3.3
@nx/devkit             : 20.3.3
@nx/eslint-plugin      : 20.3.3
@nx/module-federation  : 20.3.3
@nx/web                : 20.3.3
@nx/webpack            : 20.3.3
typescript             : 5.6.3
---------------------------------------
Community plugins:
angular-eslint : 19.0.2

Failure Logs

Package Manager Version

pnpm 9.15.4

Operating System

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

Additional Information

No response

@schreibse
Copy link

Yes, there is a way.
Please have a look at the NX Console Plugin

@lobo78
Copy link
Author

lobo78 commented Jan 29, 2025

@schreibse I have tried the NX Console plugin, but I struggled to get it to work. When I click the "Generate (UI)" command, nothing happens. When I try the same thing in VS Code, I get this message: "No generators found. Did you run npm/pnpm/yarn install?", which of course I have.

I am able to run generators from the terminal, just not in the IDE. (i.e. this works: pnpm nx generate @nx/angular:component ...). I'm not sure if I'm doing something wrong or if NX console is just buggy.

Unfortunately, my organization is currently stuck on an old version of Node.js, so I'm testing with NX 16.

`Node : 16.20.2
OS : darwin-arm64
pnpm : 8.11.0

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
@nx/storybook : 16.10.0
@nrwl/tao : 16.10.0
@nx/webpack : 16.10.0
nx-cloud : 19.1.0
typescript : 4.9.5

Community plugins:
@fortawesome/angular-fontawesome : 0.10.2
@ng-bootstrap/ng-bootstrap : 14.2.0
@ngrx/component-store : 15.3.0
@ngrx/effects : 15.3.0
@ngrx/entity : 15.3.0
@ngrx/router-store : 15.3.0
@ngrx/schematics : 15.3.0
@ngrx/store : 15.3.0
@ngrx/store-devtools : 15.3.0
@sf/schematics : 0.0.2
@storybook/angular : 7.6.9
@testing-library/angular : 14.5.1
ngx-toastr : 16.2.0
`

Here is the output from idea.log when I try to open the "Generate (UI)" dialog:

2025-01-29 16:47:23,564 [ 878031] FINER - #dev.nx.console.nxls.NxlsWrapper - Error from nxls: Request nx/generators failed with message: Cannot read properties of undefined (reading 'generators') 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - Exception in thread "DefaultDispatcher-worker-10" org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request nx/generators failed with message: Cannot read properties of undefined (reading 'generators') 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at dev.nx.console.nxls.NxlsWrapper.start$lambda$10$lambda$9(NxlsWrapper.kt:110) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) 2025-01-29 16:47:23,565 [ 878032] INFO - STDERR - at java.base/java.lang.Thread.run(Thread.java:1583) 2025-01-29 16:47:23,566 [ 878033] INFO - STDERR - Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ProjectImpl@418848641), com.intellij.codeWithMe.ClientIdContextElementPrecursor@7f56c14e, CoroutineName(dev.nx.console.generate.NxGenerateService), StandaloneCoroutine{Cancelling}@6a200bdf, Dispatchers.Default]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants