Freeze when building with VSCode

I installed it on Windows 11 by following Sui Documents.
After that, when I write code in VSCode and run sui move build ( or sui move test ) in terminal, it freezes.
If VSCode is closed in that state, Build proceeds along with Git Update.
This is a very cumbersome problem, is there a solution?

4 Likes

Hello, I was gonna open a topic with this exact problem, but the forum correctly said my problem was exactly equal to yours (way to go devs, this was awesome). Did you manage to fix this issue? I tried with two computers already.
build

Try delete all your extensions which relate to Move or Sui, left only “Move syntax” extension of Damir Shamanaev for syntax highlighting, then restart your vscode. That’s my workaround.

1 Like

I confirm deleting those extensions solves the problem. But it would be better if sui devs fixed this. I was about to give up my move learning because of this problem.

Hello @amnn is this to difficult to solve?

Hi @suleymansah, I’ve referred this to @awelc who is our expert on all things related to the VSCode extension.

1 Like

Please make sure that you do not have any other Move extensions installed and that you are using the most recent version of Mysten’s Move extension.

This problem was reported in the past (e.g., here and here) and I was indeed able to reproduce and implemented a fix mid last year.

I can no longer reproduce so if it’s still happening it would be great to get exact steps to reproduce (extension version, Sui binary version, code opened in VSCode, code being built in CLI).

1 Like

Thanks for reply, I just saw it. For now I could able to solve this issue by using WSL (Windows Subsytem for Linux). But if in the future I return to local windows, I will try your suggestion.

I just tried on local windows, with only latest Move extension installed, and build freeze problem exists. Move Syntax and Move Trade Debugger are in the dependencies of the Move extension, so they also got installed.

sui - V => sui 1.44.3-615516edb0ed
Vs Code (latest as for now): 1.98.2
Windows 11 Pro Version 24H2

Installed extensions are like this:

Move extension is the only move related extension (besides the dependent two I mentioned)

What’s more important here than VSCode version is the version of the Move plugin (should be 1.0.15). Also, just to make sure that you are not picking up a random version of move-analyzer from your path, please set the Force-bundled option in Move plugin’s settings.

Additionally, after you quit VSCode please check in the task manager that there are no sui or move-analyzer processes running.

Finally, I’d need more info about your setup. In particular, what code you have opened in VSCode and what code you are trying to build on command line. As I mentioned, I cannot reproduce it - when trying random code in VSCode and command line, everything works for me without being blocked…

1 Like

Move Plugin version => 1.0.15 (latest as for now)
I enabled Force-bundled in Move plugin settings for both user and workspace.
I don’t see any sui or move related process in task manager.

But unfortunately sui move build continues to freeze with Move extension installed.

Here is more info, I installed sui binaries in the C:\sui folder like this


And added this folder to the systems path.

sui -V works nice, indicating it can read from system path.

I also have this move-analyzer in my windows user folder (~/.sui/bin/move-analyzer)

The code doesnt matter because I just created a new module with sui move new hello_world. And the hello_world.move content is

module hello_world::hello_world;

use std::string::String;

public fun hello_world(): String {
    b"Hello, World!".to_string()
}

And while trying to build the project with sui move build, while the module folder is opened with VS Code, build command freezes. It doesn’t freeze while the folder is not opened in VS Code.

Thank you! And I really appreciate your patience! I have another idea - it may be related to another Windows issue that I am debugging right now. To confirm, could you please provide here the output in VSCode’s “View->Output->Move” window right after you open your Move source file in VSCode?

Here is that info.

and Move Client window, in case it helps

Yes, that’s the same thing. For some reason, move-analyzer gets stuck on Windows in some cases. I can reproduce this one and I am on it. Will keep you posted!

1 Like

Published a new version of the extension that should fix the problem. Please update, try, and let me know! After updating, run “Move: Show Server Version” command from the command palette to make sure that you have move-analyzer v1.46.0 installed.

@awelc I could’nt reply because of forum reply limits, so I edited this reply.

I followed the exact steps you told, but popup errors still continue. Anyway,
the build problem was solved, and I am happy to use WSL. Thank you for your updates, hope it will help others in the future.

I updated move extension to 1.0.16.
(I ran cargo install script and copied the newly installed move analyzer from ~/.cargo/bin to ~/.sui/bin )

Move: Show Server Version shows 1.46

Indeed this solved the freeze problem while trying to build when the vs code is open.

But I started to get many popup errors in VS Code like this:

Is there anything I can do to prevent there errors?

Move output shows these logs:
Starting language server ‘c:\Users\susah.sui\bin\move-analyzer.exe’ communicating via stdio…

linting level Default

starting symbolicator runner loop

symbolicating “d:\move\hello_world”

From github link (forum doesn’t allow link)

  • [new branch] aschran/cc-load-test → origin/aschran/cc-load-test

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found ‘published-at’, ‘version’

created pre-compiled libs for “d:\move\hello_world”

compiled to parsed AST

compiled to typed AST

compiling to CFGIR

compiled to CFGIR

compilation complete in: 4.5910171s

caching pre-compiled program and pre-computed symbols

analysis complete in 1.1496191s

get_symbols load complete

inlay type hints enabled: false

inlay param hints enabled: false

[Error - 11:29:39 PM] Client Move: connection to server is erroring.

Header must provide a Content-Length property.

{“head is now at 615516edb0 [consensus] enable garbage collection & new commit rule for testnet on version 77 (#21449)\ncontent-length”:“342”}

Shutting down server.

[Error - 11:29:39 PM] Stopping server failed

Error: Client is not running and can’t be stopped. It’s current state is: starting

at LanguageClient.shutdown (c:\Users\susah.vscode\extensions\mysten.move-1.0.16-win32-x64\node_modules\vscode-languageclient\lib\common\client.js:964:19)

at LanguageClient.stop (c:\Users\susah.vscode\extensions\mysten.move-1.0.16-win32-x64\node_modules\vscode-languageclient\lib\common\client.js:935:21)

at LanguageClient.stop (c:\Users\susah.vscode\extensions\mysten.move-1.0.16-win32-x64\node_modules\vscode-languageclient\lib\node\main.js:150:22)

at LanguageClient.handleConnectionError (c:\Users\susah.vscode\extensions\mysten.move-1.0.16-win32-x64\node_modules\vscode-languageclient\lib\common\client.js:1196:18)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

[Error - 11:29:41 PM] Server initialization failed.

Message: Pending response rejected since connection got disposed

Code: -32097

[Info - 11:29:41 PM] Connection to server got closed. Server will restart.

true

[Error - 11:29:41 PM] Move client: couldn’t create connection to server.

Message: Pending response rejected since connection got disposed

Code: -32097

[Error - 11:29:41 PM] Server process exited with code 1.

Please do not install move-analyzer.exe separately. As mentioned in the extension’s installation instructions in the VSCode Marketplace, the move-analyzer.exe binary is automatically installed.

Please try the following:

  • uninstall Move extension
  • quite VSCode
  • remove move-analyzer.exe from ~/.sui/bin
  • start VSCode
  • install Move extension

@awelc I have the same issue, which started after the update to 1.0.16.
It seems like it breaks the pre-compiled deps in the .move.
For me, the only way to get it work again is to close the vscode, delete .move folder and open vscode again. And repeat each 15 minutes :frowning:
Logs are truncated, but it shows the root issue:

created pre-compiled libs for "/Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm"
compiled to parsed AST
compiled to typed AST
compiling to CFGIR
compiled to CFGIR
compilation complete in: 3.698645292s
caching pre-compiled program and pre-computed symbols
analysis complete in 235.458583ms
get_symbols load complete
symbolication finished
symbolication started
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"id\":1107,\"result\":null}HEAD is now at 0c89008 Upgrade sui framework to mainnet-v1.23.1\nContent-Length: 235"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/acl.move\",\"diagnostics\":[]}}Content-Length: 238"}
Shutting down server.
symbolicating "/Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm"
Warning: unknown field names found. Expected one of [name, authors, license, edition, flavor], but found 'published-at', 'version'
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/config.move\",\"diagnostics\":[]}}Content-Length: 239"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/factory.move\",\"diagnostics\":[]}}Content-Length: 246"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/math/clmm_math.move\",\"diagnostics\":[]}}Content-Length: 246"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/math/tick_math.move\",\"diagnostics\":[]}}Content-Length: 239"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/partner.move\",\"diagnostics\":[]}}Content-Length: 236"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/pool.move\",\"diagnostics\":[]}}Content-Length: 244"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/pool_creator.move\",\"diagnostics\":[]}}Content-Length: 240"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/position.move\",\"diagnostics\":[]}}Content-Length: 240"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/rewarder.move\",\"diagnostics\":[]}}Content-Length: 236"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/tick.move\",\"diagnostics\":[]}}Content-Length: 237"}
Shutting down server.
[Error - 19:10:21] Client Move: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///Users/some/.move/https___github_com_CetusProtocol_cetus-clmm-interface_git_testnet-v1.26.0/sui/cetus_clmm/sources/utils.move\",\"diagnostics\":[]}}Content-Length: 227"}
Shutting down server.

Thank you for the report. A fix is about 1hr away

1 Like