nrwl / nx-console

Nx Console is the user interface for Nx & Lerna.
https://nx.dev
MIT License
1.31k stars 211 forks source link

IntelliJ Plugin 1.13.1 (Webstorm 2023.2.X) issues #1886

Closed lewsmith closed 9 months ago

lewsmith commented 1 year ago

Current Behavior

With the IntelliJ plugin installed in Webstorm I get a couple of issues. I see these issues with other versions of the plugin too.

I have a simple Next based project all generated from the Nx CLI.

First issue is on start up. IntelliJ shows the annoying red exclamation mark (bottom right). Here's the details:

Stacktrace:
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access is allowed from Event Dispatch Thread (EDT) only; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[DefaultDispatcher-worker-1,6,main] 109452250 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 1199414589
    at com.intellij.openapi.application.impl.ApplicationImpl.createThreadAccessException(ApplicationImpl.java:1083)
    at com.intellij.openapi.application.impl.ApplicationImpl.throwThreadAccessException(ApplicationImpl.java:1078)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1066)
    at com.intellij.ui.SpeedSearchBase.isPopupActive(SpeedSearchBase.java:210)
    at com.intellij.ui.speedSearch.SpeedSearchSupply.getSupply(SpeedSearchSupply.java:55)
    at com.intellij.ui.speedSearch.SpeedSearchSupply.getSupply(SpeedSearchSupply.java:44)
    at com.intellij.ui.speedSearch.SpeedSearchUtil.applySpeedSearchHighlightingFiltered(SpeedSearchUtil.java:185)
    at com.intellij.ui.ColoredTreeCellRenderer.rendererComponentInner(ColoredTreeCellRenderer.java:129)
    at com.intellij.ui.ColoredTreeCellRenderer.getTreeCellRendererComponent(ColoredTreeCellRenderer.java:58)
    at com.intellij.ui.tree.ui.DefaultTreeUI.getRenderer(DefaultTreeUI.java:189)
    at com.intellij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(DefaultTreeUI.java:582)
    at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:497)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1344)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache.updateNodeSizes(VariableHeightLayoutCache.java:903)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache.invalidateSizes(VariableHeightLayoutCache.java:371)
    at java.desktop/javax.swing.plaf.basic.BasicTreeUI$Handler.propertyChange(BasicTreeUI.java:3933)
    at com.intellij.ui.tree.ui.DefaultTreeUI$5.propertyChange(DefaultTreeUI.java:712)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
    at java.desktop/java.awt.Component.firePropertyChange(Component.java:8759)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1200)
    at java.desktop/java.awt.Container.updateChildGraphicsData(Container.java:1187)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1192)
    at java.desktop/java.awt.Container.updateChildGraphicsData(Container.java:1187)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1192)
    at java.desktop/java.awt.Component.setGraphicsConfiguration(Component.java:1180)
    at java.desktop/java.awt.Container.lambda$addImpl$0(Container.java:1140)
    at java.desktop/sun.awt.SunToolkit.lambda$performWithTreeLock$1(SunToolkit.java:2139)
    at java.desktop/sun.awt.SunToolkit.performOnMainThreadIfNeeded(SunToolkit.java:2164)
    at java.desktop/sun.awt.SunToolkit.performWithTreeLock(SunToolkit.java:2137)
    at java.desktop/java.awt.Container.addImpl(Container.java:1104)
    at java.desktop/java.awt.Container.add(Container.java:1001)
    at com.intellij.openapi.ui.SimpleToolWindowPanel.setContent(SimpleToolWindowPanel.java:188)
    at dev.nx.console.nx_toolwindow.NxToolWindowPanel$createToolwindowContent$1.invokeSuspend(NxToolWindowPanel.kt:52)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
ThreadDump:

treaddump.log


The next issue I have is the 'View full project graph' function just does not work. I hit the button and get an error in the notifications bar, and an 'Nx Graph' window with just a loading icon.

The notification error content is:

Nx Console ran into problems reading your workspace files: 
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 37 path $.result
 Make sure to double-check your project.json & nx.json files for syntax errors below.

I click the 'Analyze configuration files' action and this just produces another notification:

We couldn't find any problems in your Nx configuration files. Is the $schema property specified?

My project.json config does contain the $schema property.

Expected Behavior

I expect no IDE Internal Errors to be thrown and the Nx Graph to show the graph.

Steps to Reproduce

Create a NextJS Nx workspace. Install the plugin into Webstorm. Open project.

Failure Logs / Images / Videos

Screenshot_20230915_150803

Environment

Nx Report:

Node   : 18.17.1
OS     : linux-x64
pnpm   : 8.7.5

nx                 : 16.8.1
@nx/js             : 16.8.1
@nx/jest           : 16.8.1
@nx/linter         : 16.8.1
@nx/workspace      : 16.8.1
@nx/cypress        : 16.8.1
@nx/devkit         : 16.8.1
@nx/eslint-plugin  : 16.8.1
@nx/nest           : 16.8.1
@nx/next           : 16.8.1
@nx/node           : 16.8.1
@nx/react          : 16.8.1
@nrwl/tao          : 16.8.1
@nx/web            : 16.8.1
@nx/webpack        : 16.8.1
typescript         : 5.1.6
MaxKless commented 1 year ago

Thanks for the report, we'll look into it. First of all: Can you reproduce this behavior on your machine in the nx-examples repo?

IntelliJ shows the annoying red exclamation mark (bottom right). Here's the details:

This should be fixed with https://github.com/nrwl/nx-console/pull/1885 If you could install the plugin below from disk (via Preferences -> Plugins -> ⚙️ -> Install Plugin from Disk) and see if that fixes things for you it would be a great help!

nx-console-0.0.1.zip Could you provide some logs?

The notification error content is: Nx Console ran into problems reading your workspace files: This is something we've seen before, often because of some misconfiguration in the project. Does it happen in nx examples? Either way, could you provide some logs? Go to Help > Diagnostic Tools > Debug Log Settings... and then insert #dev.nx.console:trace. Then paste the idea.log or sections of it when the error happens.

Also the daemon.log & daemon-error.log would be useful. You can find their location by running nx daemon --log

marcvangend commented 10 months ago

I'm seeing similar issues with PhpStorm and MacOs. Is this issue still active?

MaxKless commented 10 months ago

I saw and fixed something like this recently. If this still happens after the next release (beginning of Jan), I'd love to know :)

MaxKless commented 9 months ago

Hey @lewsmith @marcvangend is this still happening for you?

lewsmith commented 9 months ago

Hey @lewsmith @marcvangend is this still happening for you?

Hi @MaxKless, seems to be working perfectly now. Nice work, thank you! :+1:

MaxKless commented 9 months ago

Nice! Thanks again for helping out and making Nx Console a bit better for everyone :)