etkachev / nx-webstorm

Plugin for Webstorm that strives to function the same as Nx Console for VsCode. UI for Nx
MIT License
35 stars 4 forks source link

Bug 🐞: Can't run @nrwl/react component generator #76

Closed shaharkazaz closed 3 years ago

shaharkazaz commented 3 years ago

Current Behavior

Can't run the command.

How to Reproduce

Try and run the command via the plugin

Envirounment:

Node : 12.20.0 OS : darwin x64 (MacOS Big Sur) Webstorm: 2021.2.3 npm : 7.24.1

nx : 13.0.2 @nrwl/angular : Not Found @nrwl/cli : 13.0.2 @nrwl/cypress : 13.0.2 @nrwl/devkit : 13.0.2 @nrwl/eslint-plugin-nx : 13.0.2 @nrwl/express : Not Found @nrwl/jest : 13.0.2 @nrwl/linter : 13.0.2 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/react : 13.0.2 @nrwl/schematics : Not Found @nrwl/tao : 13.0.2 @nrwl/web : 13.0.2 @nrwl/workspace : 13.0.2 @nrwl/storybook : 13.0.2 @nrwl/gatsby : Not Found typescript : 4.3.5

Additional context

The error stack:

java.lang.NullPointerException
    at com.github.etkachev.nxwebstorm.services.MyProjectService.getProjects(MyProjectService.kt:162)
    at com.github.etkachev.nxwebstorm.services.MyProjectService.getProjectList(MyProjectService.kt:84)
    at com.github.etkachev.nxwebstorm.utils.GenerateFormControl.<init>(GenerateFormControl.kt:20)
    at com.github.etkachev.nxwebstorm.ui.RunSchematicPanel.<init>(RunSchematicPanel.kt:42)
    at com.github.etkachev.nxwebstorm.actionlisteners.SchematicSelectionTabListener.runSelectedLogic(SchematicSelectionTabListener.kt:139)
    at com.github.etkachev.nxwebstorm.actionlisteners.SchematicSelectionTabListener.valueChanged$lambda-2(SchematicSelectionTabListener.kt:125)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
elicul commented 3 years ago

Hi @shaharkazaz I'm facing the same issue is there any workaround for this?

shaharkazaz commented 3 years ago

@elicul Unfortunately, I don't have one.

etkachev commented 3 years ago

Hey guys. Thanks for bringing this to my attention. Do you have a repo I can use to try to reproduce? Even a basic repo created that can reproduce the same issue. Thanks!

shaharkazaz commented 3 years ago

@etkachev Didn't do anything special, created a fresh react project via the nx cli, tried running the command and it crashed.

elicul commented 3 years ago

@etkachev I'm working on a private repo so I can't share this code but I'll create a fresh project and try it there.

elicul commented 3 years ago

@etkachev here is the reproduction repo link, it's a nx workspace with an angular app. I'm using the latest webstorm and nx-webstorm plugin.

Yanduz commented 3 years ago

I have the same problem Webstorm - 2021.2.3 Angular - 12.2.12 nx - 13.1.2

A workaround for me is to use a similar plugin for VSCode to generate the component like in Webstorm

Xnip2021-10-29_16-55-50

etkachev commented 3 years ago

Yup I believe this has to do with the recent Nx 13 upgrade. Since all the nx.json does not have projects in there anymore. All projects are now declared in the workspace.json or angular.json. I will have a fix for this shortly.

elicul commented 3 years ago

Thank you @etkachev. If you need any help in testing/helping just ping me.

etkachev commented 3 years ago

nx-webstorm - 0.9.1.zip

Can you guys give this a try? You will have to manually install the plugin. Let me know. Thanks!

Yanduz commented 3 years ago

@etkachev Great, it works! Thanks 👍 (Angular Project)

elicul commented 3 years ago

@etkachev works great! Thank you!

etkachev commented 3 years ago

Awesome. I published the fix to jetbrains. Might be a few days before they approve it and release it to marketplace.

etkachev commented 3 years ago

latest 0.9.1 is available for update. Let me know if there is anything else that comes up. Thanks!

shaharkazaz commented 3 years ago

@etkachev This works, but only if I'm working with per-project configuration. I think you should still support getting the values from the angular.json Thanks for the fix 🙂

etkachev commented 3 years ago

@shaharkazaz are you referring to when your project is setup with the project.json files? That it doesn't work? Like mentioned here in the docs

shaharkazaz commented 3 years ago

@etkachev It was a bug on my end, the project I was trying to execute the commands on wasn't listed correctly. sorry for the noise 🙂