nx-console
nx-console copied to clipboard
WebStorm Freezes During GIT Merge with NX-Console Plugin Installed
Current Behavior
I am experiencing an issue where WebStorm (version 2024.1.1) freezes when attempting to merge certain files if the NX-Console plugin (version 1.21.0) is installed. This problem does not occur in projects with fewer dependencies or when the plugin isn't installed.
Here is a video showing that behaviour (note: it happens when I open the package.json the second time):
This issue happens only for some projects, for example I have another "smaller" project with fewer dependencies in the package.json and there the issue doesn't happen at all.
This issue happens since ~March, but maybe longer. Maybe it is related to an update.
The IDE freezes and gets unresponsive. I have to kill it via the task manager and restart.
Expected Behavior
I can merge the files as usual. There are no problems when opening a package.json / project.json while doing a merge.
Steps to Reproduce
Failure Logs / Images / Videos
IDE.log when this issue happens:
2024-04-23 07:31:32,143 [ 6286] INFO - #c.i.u.i.UnindexedFilesScanner - Cancelled indexing of ui_new
2024-04-23 07:31:32,147 [ 6290] INFO - #c.i.o.p.MergingQueueGuiExecutor - Task canceled (PCE): UnindexedFilesScanner[ui_new]
2024-04-23 07:31:32,148 [ 6291] INFO - #c.i.o.p.MergingQueueGuiExecutor - Task finished: UnindexedFilesScanner[ui_new]
2024-04-23 07:31:32,148 [ 6291] INFO - #c.i.o.p.MergingQueueGuiExecutor - Running task: UnindexedFilesScanner[ui_new]
2024-04-23 07:31:32,149 [ 6292] INFO - #c.i.u.i.UnindexedFilesScanner - Started scanning for indexing of ui_new. Reason: Reindex of changed dependencies requested, but status is not initialized
2024-04-23 07:31:32,149 [ 6292] INFO - #c.i.u.i.UnindexedFilesScanner - Performing delayed pushing properties tasks for ui_new took 0ms; general responsiveness: ok; EDT responsiveness: ok
2024-04-23 07:31:32,166 [ 6309] INFO - #c.i.u.i.UnindexedFilesScanner - Scanning of ui_new uses 15 scanning threads
2024-04-23 07:31:32,402 [ 6545] INFO - #c.i.o.v.i.p.NewMappings - VCS Root: [Git] - [<Project>]
2024-04-23 07:31:32,441 [ 6584] INFO - #c.i.o.e.s.p.m.ExternalProjectsDataStorage - Load external projects data in 5 millis (read time: 5)
2024-04-23 07:31:32,491 [ 6634] INFO - #c.i.o.p.SmartModeScheduler - Post-startup activity executed. Current mode: 5
2024-04-23 07:31:32,492 [ 6635] INFO - #c.i.i.s.p.i.BundledSharedIndexPostStartupActivity - Attached 1 pre-built shared indexes: bundled-js-predefined-1d06a55b98c1-2e7d6887c066-JavaScript-WS-241.15989.47
2024-04-23 07:31:32,508 [ 6651] INFO - #c.i.d.PerformanceWatcherImpl - Post-startup activities under progress took 231ms; general responsiveness: ok; EDT responsiveness: ok
2024-04-23 07:31:32,513 [ 6656] INFO - #c.i.i.s.IdeStartupScripts - 0 startup script(s) found
2024-04-23 07:31:32,573 [ 6716] INFO - #dev.nx.console.nxls.NxlsProcess - Staring the nxls process in workingDir C:/Webdevelopment/sources/ui_new
2024-04-23 07:31:32,573 [ 6716] INFO - #dev.nx.console.nxls.NxlsProcess - nxls found via C:\Webdevelopment\WebStorm\Plugins\nx-console\nxls\main.js
2024-04-23 07:31:32,588 [ 6731] INFO - #git4idea.commands.GitHandler - [.] git version
2024-04-23 07:31:32,629 [ 6772] INFO - #c.i.o.v.i.p.NewMappings - Mapped Roots: 1
2024-04-23 07:31:32,630 [ 6773] INFO - #c.i.o.v.i.p.NewMappings - Detected mapped Root: [Git] - [C:/Webdevelopment/sources/ui_new]
2024-04-23 07:31:32,678 [ 6821] INFO - #c.i.j.n.l.n.NodeModulesDirectoryManager - Contributed {allCalculationsDuration:156 ms, allIncludedFileCount:2421, allRootsSyntheticLibrary:172, allRootsWorkspaceModel:720, allSourceRootsSyntheticLibrary:145, allSourceRootsWorkspaceModel:414, allExcludedRootsSyntheticLibrary:27, allExcludedRootsWorkspaceModel:306, libraries:3}
2024-04-23 07:31:32,895 [ 7038] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scheduling indexing of device-battery.component.html by request of indexes: [filetypes->OUT_DATED,]. Scanner has updated file device-battery.component.html with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=347903, fileInfo='device-battery.component.html(id=347903)'}] and removers: [];
2024-04-23 07:31:32,933 [ 7076] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scheduling indexing of device-events-button.component.html by request of indexes: [filetypes->OUT_DATED,]. Scanner has updated file device-events-button.component.html with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=347920, fileInfo='device-events-button.component.html(id=347920)'}] and removers: [];
2024-04-23 07:31:32,970 [ 7113] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scheduling indexing of state-bar.component.html by request of indexes: [filetypes->OUT_DATED,]. Scanner has updated file state-bar.component.html with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=347890, fileInfo='state-bar.component.html(id=347890)'}] and removers: [];
2024-04-23 07:31:32,972 [ 7115] INFO - #git4idea.commands.GitHandler - git version 2.44.0.windows.1
2024-04-23 07:31:32,991 [ 7134] INFO - #git4idea.config.GitExecutableManager - Git version for C:\Program Files\Git\cmd\git.exe: 2.44.0.0 (MSYS)
2024-04-23 07:31:33,145 [ 7288] INFO - #c.i.j.n.l.n.NodeModulesDirectoryManager - node_modules entities synchronized in 672 ms, 3 excludes, 3 libraries
2024-04-23 07:31:33,162 [ 7305] INFO - #c.i.w.i.i.EntitiesOrphanageImpl - Update orphanage. 0 modules added
2024-04-23 07:31:33,165 [ 7308] INFO - #c.i.w.i.i.WorkspaceModelImpl - Project model updated to version 3 in 64 ms: node_modules exclude: {current=3, new=3, up-to-date}, node_modules library: {current=3, new=3, outdated}
2024-04-23 07:31:33,215 [ 7358] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scheduling indexing of device-parameters.component.html by request of indexes: [filetypes->OUT_DATED,]. Scanner has updated file device-parameters.component.html with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=347955, fileInfo='device-parameters.component.html(id=347955)'}] and removers: [];
2024-04-23 07:31:33,236 [ 7379] INFO - #dev.nx.console.nxls.NxlsProcess - nxls started: Process[pid=7228, exitValue="not exited"]
2024-04-23 07:31:33,276 [ 7419] INFO - #c.i.u.i.IndexingReasonExplanationLogger - Scheduling indexing of device-tests.component.html by request of indexes: [filetypes->OUT_DATED,]. Scanner has updated file device-tests.component.html with appliers: [SingleIndexValueApplier{indexId=filetypes, inputId=347950, fileInfo='device-tests.component.html(id=347950)'}] and removers: [];
2024-04-23 07:31:33,955 [ 8098] INFO - #c.i.x.Html5SchemaProvider - HTML5_SCHEMA_LOCATION = C:/Webdevelopment/IDE/WebStorm 2024.1/lib/app.jar!/resources/html5-schema/html5.rnc
2024-04-23 07:31:34,378 [ 8521] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.365Z - Initializing Nx Language Server
2024-04-23 07:31:34,383 [ 8526] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.382Z - Retrieving workspace configuration
2024-04-23 07:31:34,793 [ 8936] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.792Z - Using local Nx package at C:/Webdevelopment/sources/ui_new/node_modules/nx/src/project-graph/file-utils.js
2024-04-23 07:31:34,797 [ 8940] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.793Z - Using local Nx package at C:/Webdevelopment/sources/ui_new/node_modules/nx/src/project-graph/project-graph.js
2024-04-23 07:31:34,798 [ 8941] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.793Z - Using local Nx package at C:/Webdevelopment/sources/ui_new/node_modules/nx/src/utils/output.js
2024-04-23 07:31:34,809 [ 8952] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.796Z - Using local Nx package at C:/Webdevelopment/sources/ui_new/node_modules/nx/src/project-graph/file-map-utils.js
2024-04-23 07:31:34,809 [ 8952] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.796Z - Using local Nx package at C:/Webdevelopment/sources/ui_new/node_modules/nx/src/daemon/client/client.js
2024-04-23 07:31:35,266 [ 9409] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:34.816Z - createProjectGraphAndSourceMapsAsync
2024-04-23 07:31:35,266 [ 9409] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:35.253Z - Unable to get project graph
2024-04-23 07:31:35,266 [ 9409] INFO - #dev.nx.console.nxls.client.NxlsLanguageClient - [Nxls] - 2024-04-23T05:31:35.265Z - Error: Unable to create nodes for package-lock.json using plugin nx/js/dependencies-and-lockfile.
Inner Error: Error: InvalidSymbol in C:\Webdevelopment\sources\ui_new\package.json at 327:1
325 | "@types/roslib": "^1.3.4",
326 | "@types/validator": "^13.7.17",
> 327 | <<<<<<< HEAD
| ^^^^^^^
328 | "@jh-wm/backend-export-pdf": "0.0.32",
329 | "@jh-wm/backend-node": "0.0.31",
330 | "@jh-wm/base": "0.1.33",
at parseJson (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\utils\json.js:25:15)
at readJsonFile (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\utils\fileutils.js:22:37)
at jsPluginConfig (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\plugins\js\utils\config.js:32:54)
at exports.createNodes (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\plugins\js\index.js:23:58)
at buildProjectsConfigurationsFromProjectPathsAndPlugins (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:146:29)
at createProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:89:156)
at _retrieveProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:61:12)
at retrieveProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:46:12)
at async buildProjectGraphAndSourceMapsWithoutDaemon (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\project-graph.js:71:69)
at async Object.createProjectGraphAndSourceMapsAsync (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\project-graph.js:136:25)
at buildProjectsConfigurationsFromProjectPathsAndPlugins (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:173:27)
at createProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:89:156)
at _retrieveProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:61:12)
at retrieveProjectConfigurations (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:46:12)
at async buildProjectGraphAndSourceMapsWithoutDaemon (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\project-graph.js:71:69)
at async Object.createProjectGraphAndSourceMapsAsync (C:\Webdevelopment\sources\ui_new\node_modules\nx\src\project-graph\project-graph.js:136:25)
at async XYt (C:\Webdevelopment\WebStorm\Plugins\nx-console\nxls\main.js:887:5392)
at async kFn (C:\Webdevelopment\WebStorm\Plugins\nx-console\nxls\main.js:887:7703)
Full log: idea.log
A package.json where this issue happens(without some internal dependencies that this project uses): package.json
A package.json where I don't have this issue: package.json
Environment
We are using WebStorm in a Windos 10 enviroment. WebStorm version 2024.1, NX Console Version 1.21.0.
Regarding my PC enviroment:
- My PC has 64 GB RAM and an Intel CPU. Also it has a SSD. If I check the task manager I don't see any change in CPU / RAM usage when this issue happens
Thanks for the in-depth bug report! I have a fix coming out soon that should make this behavior better :) I'll let you know once it's out
That is good to hear, thanks for preparing the fix, looking forward to it! :)
Hey! I'm not sure why Nx Console is freezing here...
but the underlying issue should be resolved with Nx 19 & the NX_ISOLATE_PLUGINS=true env var.
If you could try upgrading your project to 19.0.0-rc.1 & adding the env var to your .env file that would be a big help! Does the issue still happen then?
@MaxKless Thanks for the suggestion, I tried it with nx 19 (sorry that that took so long but due to company restrictions and the big project an update isn't that easy). Unfortunally that didn't help.
However, for the update I tried to delete the whole local nx cache (.nx folder in the project). It seems like this helped because after I did that I never faced the issue anymore.
Also it seems to make a difference where the .nx folder is. If it is part of node_modules I don't have any issues. If it is outside I have issues. Note on that: The .nx folder is of course excluded:
That finding would also match with the time when this problem occured the first time, after we migrated to nx 17 where they changed the standard cache to be outside of the node_modules and it got more unstable from month to month. So I would say that probably this is the root of the problem.
The size of that folder in our case is worrying big (almost 1 GB) - probably nx should remove cached entries after some time too.
Is your plugin using that folder in any kind and gets problems with that folder if it is too big?
Hey! Thanks for taking the time to investigate here.
No, the size of the .nx/cache folder shouldn't be a problem. For example, my current one in Nx Console is over 7GB large and nx can deal with it no problem.
I think the merge conflict error might be more related. From the logs above you can see that calculating the project graph failed, maybe Nx Console got in a weird state somehow?
Can you confirm that after running nx reset, you're not seeing the issue anymore?
It works but only for some time. The freezed WebStorm appears again after 2 weeks. As written before, WebStorm only freezes in case there is this plugin enabled. I understand that you don't do something with the nx cache but it seems like this is having some side effect.
does running nx reset help? Are you on the latest version? Are the errors in the logs the same again with the nx/js/dependencies-and-lockfile?