nx-console icon indicating copy to clipboard operation
nx-console copied to clipboard

Freezing the IDE when navigating into package.json

Open mklueh opened this issue 1 year ago • 12 comments

Current Behavior

My IDE is constantly freezing. I didn't know why but this time the error message popped up in the IDE after killing all Node processes

Expected Behavior

Steps to Reproduce

Failure Logs / Images / Videos

org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Die Pipe wurde beendet
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:72)
	at dev.nx.console.nxls.NxlsWrapper.start$lambda$7$lambda$6(NxlsWrapper.kt:97)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.notify(RemoteEndpoint.java:126)
	at org.eclipse.lsp4j.jsonrpc.services.EndpointProxy.invoke(EndpointProxy.java:88)
	at jdk.proxy4/jdk.proxy4.$Proxy208.didOpen(Unknown Source)
	at dev.nx.console.nxls.managers.DocumentManager.documentOpened(DocumentManager.kt:123)
	at dev.nx.console.nxls.NxlsWrapper.connectTextService(NxlsWrapper.kt:207)
	at dev.nx.console.nxls.NxlsWrapper.connect(NxlsWrapper.kt:178)
	at dev.nx.console.nxls.NxlsService.addDocument(NxlsService.kt:174)
	at dev.nx.console.listeners.NxEditorListener.editorCreated(NxEditorListener.kt:35)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.lambda$doCreateEditor$4(EditorFactoryImpl.java:229)
	at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.forEachExtensionSafe(ExtensionProcessingHelper.kt:34)
	at com.intellij.openapi.extensions.ExtensionPointName.forEachExtensionSafe(ExtensionPointName.kt:50)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.doCreateEditor(EditorFactoryImpl.java:229)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createMainEditor(EditorFactoryImpl.java:213)
	at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider$createEditorBuilder$2$1.build(PsiAwareTextEditorProvider.kt:125)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.createComposite(FileEditorManagerImpl.kt:1206)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$openFileInEdt$2$1.invokeSuspend(FileEditorManagerImpl.kt:2164)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:43)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
	at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:396)
	at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:156)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:134)
	at com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:12)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:134)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:48)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:122)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:118)
	at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:86)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:118)
	at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:173)
	at com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:100)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openEditorImpl(FileEditorManagerImpl.kt:1346)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileEditor(FileEditorManagerImpl.kt:1312)
	at com.intellij.openapi.fileEditor.FileNavigatorImplKt.navigateInAnyFileEditor(FileNavigatorImpl.kt:97)
	at com.intellij.openapi.fileEditor.FileNavigatorImplKt.access$navigateInAnyFileEditor(FileNavigatorImpl.kt:1)
	at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigateInEditor(FileNavigatorImpl.kt:55)
	at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigateInEditorOrNativeApp(FileNavigatorImpl.kt:50)
	at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigate(FileNavigatorImpl.kt:32)
	at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigate(OpenFileDescriptor.java:88)
	at com.intellij.psi.impl.source.PsiFileImpl.navigate(PsiFileImpl.java:907)
	at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement$lambda$3(NavigationUtil.kt:158)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:225)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)
	at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.kt:154)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:306)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:316)
	at com.intellij.ide.projectView.impl.nodes.PsiFileNode.navigate(PsiFileNode.java:117)
	at com.intellij.util.EditSourceOnEnterKeyHandler.lambda$install$0(EditSourceOnEnterKeyHandler.java:52)
	at com.intellij.util.EditSourceOnEnterKeyHandler.lambda$onEnterKey$1(EditSourceOnEnterKeyHandler.java:88)
	at java.desktop/javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3486)
	at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
	at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2943)
	at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:2991)
	at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2905)
	at com.intellij.ui.treeStructure.Tree.processKeyEvent(Tree.java:417)
	at java.desktop/java.awt.Component.processEvent(Component.java:6434)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849)
	at com.intellij.ide.IdeKeyboardFocusManager.access$dispatchEvent$s1569605750(IdeKeyboardFocusManager.kt:18)
	at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
	at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.kt:25)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4904)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:623)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:581)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.io.IOException: Die Pipe wurde beendet
	at java.base/java.io.FileOutputStream.writeBytes(Native Method)
	at java.base/java.io.FileOutputStream.write(FileOutputStream.java:349)
	at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:123)
	at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:108)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:68)
	... 149 more

Environment

  • Nx Console version: 1.19.0 IntelliJ: 2023.3.4

mklueh avatar Mar 22 '24 05:03 mklueh

Yeah that makes sense that this would pop up after the node proces is killed. We need a background process (the nxls) to provide info on nx to the IDE. Who knows if Nx Console is responsbile for the freezing but it's possible.

Could you provide some logs so we can track down whether it's responsible? 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

MaxKless avatar Mar 22 '24 11:03 MaxKless

This is specifically happening in Jetbrains IDE. Disable nx Console plugin, and restart fixes the issue.

ArslanAmeer avatar Mar 24 '24 10:03 ArslanAmeer

Yeah that makes sense that this would pop up after the node proces is killed. We need a background process (the nxls) to provide info on nx to the IDE. Who knows if Nx Console is responsbile for the freezing but it's possible.

Could you provide some logs so we can track down whether it's responsible? 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

Hello.

just happened again without clicking into any JSON file, but after pressing double-shift for searching.

I've inserted the trace log setting, but need to wait until it happens again

I try to run nx daemon before killing the node process next time.

mklueh avatar Mar 25 '24 06:03 mklueh

You don't really need to run nx daemon either, it should be under .nx/cache/d/daemon.log

MaxKless avatar Apr 02 '24 09:04 MaxKless

Downgrading to nx console 1.15.1 resolved the issue for us. It has been an issue with our team on IntelliJ.

Lorondos avatar Apr 03 '24 09:04 Lorondos

Thanks for the report @Lorondos. Could you provide some logs from when the freeze happens? 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. (You can access it by running the Open log in editor command and figuring out the location from there).

With it I should be able to figure out what's going on.

MaxKless avatar Apr 03 '24 10:04 MaxKless

@MaxKless Thanks for getting back to me, I have opened one large JSON package file and it basically froze below when it was trying to connect the textService to the package.json, IntelliJ is now a grey screen with no UI elements:

2024-04-03 13:43:22,540 [ 301582]   INFO - #dev.nx.console.listeners.NxEditorListener - Connecting C:/DEV/xxx/package.json to lsp
2024-04-03 13:43:22,545 [ 301587]   INFO - #dev.nx.console.nxls.NxlsWrapper - Connecting textService to file://C:/DEV/xxx/package.json.

I opened a smaller package.json that is part of our project, and it displayed in IntelliJ without issue:

2024-04-03 13:49:19,326 [ 123037]   INFO - #dev.nx.console.listeners.NxEditorListener - Connecting C:/DEV/xxx/apps/xxx/package.json to lsp
2024-04-03 13:49:19,329 [ 123040]   INFO - #dev.nx.console.nxls.NxlsWrapper - Connecting textService to file://C:/DEV/xxx/apps/xxx/package.json
2024-04-03 13:49:19,634 [ 123345]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-04-03 13:49:20,325 [ 124036]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))
2024-04-03 13:49:21,319 [ 125030]   INFO - #c.i.p.m.MavenProjectDependenciesModel - Start collecting all modules
2024-04-03 13:49:21,322 [ 125033]   INFO - #c.i.p.g.GradleProjectDependenciesModel - Start collecting all modules
2024-04-03 13:49:21,323 [ 125034]   INFO - #c.i.p.g.GradleProjectDependenciesModel - Finish collecting all modules, count of found modules: 0
2024-04-03 13:49:21,357 [ 125068]   INFO - #c.i.p.m.i.ProjectDependenciesModelImpl - Count of declared packages: null, imported packages: 94
2024-04-03 13:49:21,393 [ 125104]   INFO - #c.i.p.m.i.ProjectDependenciesModelImpl - Count of declared packages: null, imported packages: 94
2024-04-03 13:49:22,255 [ 125966]  FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))

I will check the daemon logs shortly.

Lorondos avatar Apr 03 '24 12:04 Lorondos

No change in the daemon log from that point onwards:

[NX Daemon Server] - 2024-04-03T13:05:37.590Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-04-03T13:05:37.591Z - Closed a connection. Number of open connections: 0
[NX Daemon Server] - 2024-04-03T13:05:41.057Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:41.241Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:41.858Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:41.917Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:42.195Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:42.489Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:42.721Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:42.922Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:43.277Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:43.459Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:43.624Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:05:43.766Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:06:21.069Z - [WATCHER]: Processing file changes in outputs
[NX Daemon Server] - 2024-04-03T13:06:45.190Z - [WATCHER]: Processing file changes in outputs

It has not updated since the lockup of IntelliJ.

Lorondos avatar Apr 03 '24 13:04 Lorondos

Thanks for the logs. Did you update the debug log settings as mentioned above? I'm curious whether there's any logs showing from the LSP or if it just crashes right away. Either way that's super helpful, thank you!!

How big is the JSON file we're talking about? :P

MaxKless avatar Apr 03 '24 13:04 MaxKless

Yeah, added the trace command for nx console.

It might be related but the versions beyond 1.15.1 also no longer load the projects and targets otherwise I would expect the message about how it could not find anything, seems to have frozen with loading here too:

image

I tried a few more times and I have noticed, might be just a background thing from IntelliJ, this is logged:

2024-04-03 14:24:43,318 [ 654318]   INFO - #c.i.m.l.c.AIAssistantAllowedLevelService - Updating AIAssistantKillSwitch level: IdeLicense
2024-04-03 14:24:43,318 [ 654318]   INFO - #c.i.m.l.c.AIAssistantAllowedLevelService - Updating AIAssistantKillSwitch level: IdeLicense

Not that big, 130 lines :P

Lorondos avatar Apr 03 '24 13:04 Lorondos

Can you paste your nx report results @Lorondos?

MaxKless avatar Apr 03 '24 13:04 MaxKless

@MaxKless Sure, here you go:

   Node   : 18.2.0                                          
   OS     : win32-x64                                       
   pnpm   : 8.8.0                                           
                                                            
   nx                      : 16.9.0                         
   @nx/js                  : 16.9.0                         
   @nx/jest                : 16.9.0                         
   @nx/linter              : 16.9.0                         
   @nx/workspace           : 16.9.0                         
   @nx/eslint-plugin       : 16.9.0                         
   @nrwl/eslint-plugin-nx  : 18.0.4                         
   @nx/nest                : 16.9.0
   @nx/node                : 16.9.0
   @nx/react               : 16.9.0
   @nx/web                 : 16.9.0
   @nx/webpack             : 16.9.0
   typescript              : 5.1.6
   ---------------------------------------
   Community plugins:
   @nxkit/playwright : 3.0.2
   ---------------------------------------
   The following packages should match the installed version of nx
     - @nrwl/[email protected]

   To fix this, run `nx migrate [email protected]`

Lorondos avatar Apr 03 '24 13:04 Lorondos

Good news, this has changed with the latest IntelliJ fixes, I now get the "No projects not found" warning and package.json does not lock up, now only "No projects no found" remains to be fixed:

image

2024-05-14 17:36:13,740 [ 17483] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:36:13,740 [ 17483] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:36:13,741 [ 17484] INFO - #dev.nx.console.nxls.NxlsProcess - stopping nxls process 2024-05-14 17:36:13,741 [ 17484] INFO - #dev.nx.console.nxls.NxlsProcess - process is not alive 2024-05-14 17:36:13,742 [ 17485] INFO - #dev.nx.console.nxls.NxlsProcess - Process exited: true

[NX Daemon Server] - 2024-05-14T16:21:03.601Z - [REQUEST]: Client Request for Project Graph Received [NX Daemon Server] - 2024-05-14T16:21:03.601Z - [REQUEST]: Responding to the client. project-graph [NX Daemon Server] - 2024-05-14T16:21:03.607Z - Time taken for 'total for creating and serializing project graph' 0.46320000011473894ms [NX Daemon Server] - 2024-05-14T16:21:03.608Z - Done responding to the client project-graph [NX Daemon Server] - 2024-05-14T16:21:03.608Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 0. Response time: 7. [NX Daemon Server] - 2024-05-14T16:21:03.649Z - [REQUEST]: Client Request for Project Graph Received [NX Daemon Server] - 2024-05-14T16:21:03.649Z - [REQUEST]: Responding to the client. project-graph [NX Daemon Server] - 2024-05-14T16:21:03.655Z - Time taken for 'total for creating and serializing project graph' 0.4372999998740852ms [NX Daemon Server] - 2024-05-14T16:21:03.657Z - Done responding to the client project-graph [NX Daemon Server] - 2024-05-14T16:21:03.657Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 0. Response time: 8. [NX Daemon Server] - 2024-05-14T16:21:03.672Z - Established a connection. Number of open connections: 12 [NX Daemon Server] - 2024-05-14T16:21:03.677Z - [REQUEST]: Client Request for Project Graph Received [NX Daemon Server] - 2024-05-14T16:21:03.677Z - [REQUEST]: Responding to the client. project-graph [NX Daemon Server] - 2024-05-14T16:21:03.681Z - Time taken for 'total for creating and serializing project graph' 0.29939999990165234ms [NX Daemon Server] - 2024-05-14T16:21:03.683Z - Done responding to the client project-graph [NX Daemon Server] - 2024-05-14T16:21:03.683Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 0. Response time: 6. [NX Daemon Server] - 2024-05-14T16:21:07.524Z - [WATCHER]: Processing file changes in outputs

I can run the nx commands manually no issues, just population/refresh of the workspace project/targets fails.

Lorondos avatar May 14 '24 16:05 Lorondos

Disabled some plugins that were causing issues:

image

I will try a few more things.

Lorondos avatar May 14 '24 16:05 Lorondos

Lastest log pull, looks like the issue is with @parcel/watcher.

2024-05-14 17:42:43,962 [ 14417] INFO - #dev.nx.console.nxls.NxlsProcess - Staring the nxls process in workingDir C:/DEV/XXX 2024-05-14 17:42:43,962 [ 14417] INFO - #dev.nx.console.nxls.NxlsProcess - nxls found via C:\Users\XXX\AppData\Roaming\JetBrains\IntelliJIdea2024.1\plugins\nx-console\nxls\main.js 2024-05-14 17:42:43,971 [ 14426] INFO - #c.i.o.p.SmartModeScheduler - Post-startup activity executed. Current mode: 5 2024-05-14 17:42:44,008 [ 14463] INFO - #c.i.i.s.IdeStartupScripts - 0 startup script(s) found

2024-05-14 17:42:44,042 [ 14497] INFO - #dev.nx.console.nxls.NxlsProcess - nxls started: Process[pid=30072, exitValue="not exited"] #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: initialize (InitializeParams [ workDoneToken = null processId = null rootPath = null rootUri = null in)

2024-05-14 17:42:45,081 [ 15536] FINER - #dev.nx.console.nxls.NxlsProcess - Nxls early exit: C:\Users\XXX\AppData\Roaming\JetBrains\IntelliJIdea2024.1\plugins\nx-console\nxls\node_modules@parcel\watcher\index.js:23 throw new Error(No prebuild or local build of @parcel/watcher found. Tried ${name}. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.); ^

Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-win32-x64. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.

2024-05-14 17:42:45,082 [ 15537] INFO - #dev.nx.console.nxls.NxlsWrapper - Stopping nxls

2024-05-14 17:42:45,113 [ 15568] INFO - #dev.nx.console.nxls.NxlsWrapper - Disconnected file://C:/DEV/XXX/package.json 2024-05-14 17:42:45,113 [ 15568] INFO - #dev.nx.console.nxls.NxlsWrapper - Disconnected file://C:/DEV/XXX/XXX/XXX/package.json 2024-05-14 17:42:45,114 [ 15569] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:42:45,118 [ 15573] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: shutdown (null) 2024-05-14 17:42:45,118 [ 15573] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:42:45,124 [ 15579] INFO - #dev.nx.console.nxls.NxlsWrapper - java.util.concurrent.CancellationException 2024-05-14 17:42:45,126 [ 15581] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/sourceMapFilesToProjectMap (null) 2024-05-14 17:42:45,126 [ 15581] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:42:45,129 [ 15584] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false)) 2024-05-14 17:42:45,129 [ 15584] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited 2024-05-14 17:42:45,129 [ 15584] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false)) 2024-05-14 17:42:45,130 [ 15585] INFO - #dev.nx.console.nxls.NxlsWrapper - Unable to send messages to the nxls, the process has exited

When shutting down IntelliJ:

2024-05-14 17:59:30,204 [1020659] SEVERE - #c.i.o.e.i.ExtensionPointImpl - Container is already disposed [Plugin: dev.nx.console] com.intellij.diagnostic.PluginException: Container is already disposed [Plugin: dev.nx.console] 2024-05-14 17:59:30,211 [1020666] SEVERE - #c.i.o.e.i.ExtensionPointImpl - IntelliJ IDEA 2024.1.1 Build #IU-241.15989.150 2024-05-14 17:59:30,211 [1020666] SEVERE - #c.i.o.e.i.ExtensionPointImpl - JDK: 17.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 2024-05-14 17:59:30,212 [1020667] SEVERE - #c.i.o.e.i.ExtensionPointImpl - OS: Windows 10 2024-05-14 17:59:30,212 [1020667] SEVERE - #c.i.o.e.i.ExtensionPointImpl - Plugin to blame: Nx Console version: 1.24.0

Lorondos avatar May 14 '24 16:05 Lorondos

hmmm it's using @parcel/watcher? what nx version is this?

MaxKless avatar May 14 '24 17:05 MaxKless

@MaxKless,

$ nx --version Nx Version:

  • Local: v16.9.0
  • Global: Not found

I think one of our repos is on another NX version so I might try my luck with that.

Lorondos avatar May 14 '24 17:05 Lorondos

Yeah, we updated one of our repos to v18.3.3, getting the same issue with @parcel/watcher.

Lorondos avatar May 14 '24 17:05 Lorondos

That's so weird... There's probably some issue with your node installation... did you go through the troubleshooting steps here? https://nx.dev/recipes/nx-console/console-troubleshooting

Either way, modern versions of Nx don't use @parce/watcher anymore so this error shouldn't happen. I have a PR here that imports it lazily so the error should disappear: https://github.com/nrwl/nx-console/pull/2140

MaxKless avatar May 15 '24 10:05 MaxKless

Ah great! Thanks for that @MaxKless , I will let you know if it is resolved.

Hmm, This was with node.js 18, I tried changing the node.js interpreter to 20 in IntelliJ, same issue. Let me roll back to the last known working version again and see if I can see anything in the logs maybe.

Lorondos avatar May 15 '24 12:05 Lorondos

are you sure you have the 64-bit version of node installed @Lorondos? Stuff like that can cause issues

MaxKless avatar May 15 '24 14:05 MaxKless

are you sure you have the 64-bit version of node installed @Lorondos? Stuff like that can cause issues

Yeah, I checked the runtime running in task manager (No appended 32-bit) and the installation is in "Program Files" folder.

Rolled back to Nx Console 1.15.1 and working:

2024-05-15 15:15:01,546 [ 27864] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: initialize (InitializeParams [ workDoneToken = null processId = null rootPath = null rootUri = null initializationOptions = null capabilities = ClientCapabilities [ workspace = WorkspaceClientCapabilities [ applyEdit = true workspaceEdit = WorkspaceEditCapabilities [ documentChanges = null resourceOperations = null failureHandling = null normalizesLineEndings = null changeAnnotationSupport = null ] didChangeConfiguration = null didChangeWatchedFiles = DidChangeWatchedFilesCapabilities [ relativePatternSupport = null dynamicRegistration = null ] symbol = SymbolCapabilities [ symbolKind = null tagSupport = null resolveSupport = null dynamicRegistration = null ] executeCommand = ExecuteCommandCapabilities [ dynamicRegistration = null ] workspaceFolders = false configuration = false semanticTokens = null codeLens = null fileOperations = null inlayHint = null inlineValue = null diagnostics = null ] textDocument = TextDocumentClientCapabilities [ synchronization = SynchronizationCapabilities [ willSave = true willSaveWaitUntil = true didSave = true dynamicRegistration = null ] completion = CompletionCapabilities [ completionItem = CompletionItemCapabilities [ snippetSupport = true commitCharactersSupport = null documentationFormat = null deprecatedSupport = null preselectSupport = null tagSupport = null insertReplaceSupport = null resolveSupport = null insertTextModeSupport = null labelDetailsSupport = null ] completionItemKind = null contextSupport = null insertTextMode = null completionList = null dynamicRegistration = null ] hover = HoverCapabilities [ contentFormat = null dynamicRegistration = null ] signatureHelp = SignatureHelpCapabilities [ signatureInformation = null contextSupport = null dynamicRegistration = null ] references = ReferencesCapabilities [ dynamicRegistration = null ] documentHighlight = DocumentHighlightCapabilities [ dynamicRegistration = null ] documentSymbol = null formatting = FormattingCapabilities [ dynamicRegistration = null ] rangeFormatting = RangeFormattingCapabilities [ dynamicRegistration = null ] onTypeFormatting = OnTypeFormattingCapabilities [ dynamicRegistration = null ] declaration = null definition = DefinitionCapabilities [ linkSupport = null dynamicRegistration = null ] typeDefinition = null implementation = null codeAction = CodeActionCapabilities [ codeActionLiteralSupport = CodeActionLiteralSupportCapabilities [ codeActionKind = null ] isPreferredSupport = null disabledSupport = null dataSupport = null resolveSupport = null honorsChangeAnnotations = null dynamicRegistration = null ] codeLens = null documentLink = null colorProvider = null rename = RenameCapabilities [ prepareSupport = null prepareSupportDefaultBehavior = null honorsChangeAnnotations = null dynamicRegistration = null ] publishDiagnostics = null foldingRange = null typeHierarchy = null callHierarchy = null selectionRange = null semanticTokens = null moniker = null linkedEditingRange = null inlayHint = null inlineValue = null diagnostic = null ] notebookDocument = null window = null general = null experimental = null ] clientInfo = null locale = null trace = null workspaceFolders = SingletonList ( WorkspaceFolder [ uri = "C:\DEV\dxp-registration" name = null ] ) ]) 2024-05-15 15:15:01,694 [ 28012] INFO - #dev.nx.console.nxls.NxlsWrapper - Connecting textService to file://C:/xxx/xxx/xxx/xxx/package.json 2024-05-15 15:15:01,918 [ 28236] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scanner has updated file workspace.xml with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=1338291, fileInfo='workspace.xml(id=1338291)'}] and removers: []; 2024-05-15 15:15:03,881 [ 30199] FINER - #dev.nx.console.nxls.NxlsWrapper - Result from nxls: InitializeResult [ capabilities = ServerCapabilities [ positionEncoding = null textDocumentSync = Either [ left = Incremental right = null ] notebookDocumentSync = null hoverProvider = Either [ left = true right = null ] completionProvider = CompletionOptions [ resolveProvider = false triggerCharacters = ArrayList ( """, ":" ) allCommitCharacters = null completionItem = null workDoneProgress = null ] signatureHelpProvider = null definitionProvider = null typeDefinitionProvider = null implementationProvider = null referencesProvider = null documentHighlightProvider = null documentSymbolProvider = null workspaceSymbolProvider = null codeActionProvider = null codeLensProvider = null documentFormattingProvider = null documentRangeFormattingProvider = null documentOnTypeFormattingProvider = null renameProvider = null documentLinkProvider = DocumentLinkOptions [ resolveProvider = false workDoneProgress = false ] colorProvider = null foldingRangeProvider = null declarationProvider = null executeCommandProvider = null workspace = WorkspaceServerCapabilities [ workspaceFolders = null fileOperations = FileOperationsServerCapabilities [ didCreate = FileOperationOptions [ filters = ArrayList ( FileOperationFilter [ pattern = FileOperationPattern [ glob = "/project.json" matches = "file" options = null ] scheme = null ] ) ] willCreate = null didRename = null willRename = null didDelete = FileOperationOptions [ filters = ArrayList ( FileOperationFilter [ pattern = FileOperationPattern [ glob = "/project.json" matches = "file" options = null ] scheme = null ] ) ] willDelete = null ] ] typeHierarchyProvider = null callHierarchyProvider = null selectionRangeProvider = null linkedEditingRangeProvider = null semanticTokensProvider = null monikerProvider = null inlayHintProvider = null inlineValueProvider = null diagnosticProvider = null experimental = null ] serverInfo = null ] 2024-05-15 15:15:03,898 [ 30216] INFO - #dev.nx.console.nxls.NxlsWrapper - nxls Initialized 2024-05-15 15:15:04,219 [ 30537] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.028Z - Retrieving workspace configuration

2024-05-15 15:15:04,219 [ 30537] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.853Z - Using local Nx package at C:/xxx/xxx/node_modules/nx/src/project-graph/file-utils.js

2024-05-15 15:15:04,248 [ 30566] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.854Z - Using local Nx package at C:/xxx/xxx/node_modules/nx/src/project-graph/project-graph.js

2024-05-15 15:15:04,249 [ 30567] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.855Z - Using local Nx package at C:/xxx/xxx/node_modules/nx/src/utils/output.js

2024-05-15 15:15:04,249 [ 30567] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.859Z - Using local Nx package at C:/xxx/xxx/node_modules/nx/src/project-graph/file-map-utils.js

2024-05-15 15:15:04,249 [ 30567] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.885Z - createProjectGraphAsync

2024-05-15 15:15:04,250 [ 30568] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.935Z - createProjectGraphAsync successful

2024-05-15 15:15:04,281 [ 30599] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-05-15T14:15:02.961Z - Retrieved workspace configuration in: 933.3400000035763 ms

2024-05-15 15:15:04,240 [ 30558] FINER - #dev.nx.console.nxls.NxlsWrapper - Sending request to nxls: nx/workspace (NxWorkspaceRequest(reset=false))

2024-05-15 15:15:05,388 [ 31706] FINER - #dev.nx.console.nxls.NxlsWrapper - Result from nxls: NxWorkspace(...etc

I might just double check with our service desk to be 100% sure.

Edit: Yeah, 64-bit only.

Lorondos avatar May 15 '24 14:05 Lorondos

@MaxKless I can confirm it is fixed with 1.25.0, seeing the projects and targets displayed now, also working for another team colleague as well. 🙂

image

Thanks for looking into and fixing this! 😊

Lorondos avatar May 28 '24 10:05 Lorondos

That's great news! I forgot to link it but I fixed this issue with https://github.com/nrwl/nx-console/pull/2140

Cheers!

MaxKless avatar May 28 '24 14:05 MaxKless