Typst works fine with VSCode when I install it on my home computer. However on my work computer will not allow me to install executable files so I’ve been using a portable version of VSCode from a usb. I am able to open VSCode and install Tinymist fine, however when I want to preview the pdf file I get the following error
I once encountered a similar error on my home computer, and it turned out that I have to save the file before starting the preview.
At that time I contacted the authors of tinymist. They replied that previewing Untitled-n files could be supported, but was never tested seriously (say, what does image("a.png") in an Untitled file mean?). Therefore, the relevant code path was disabled. If more people want to use this feature, tinymist is open to support that.
(Be aware that the conversation happened months ago. I don’t know if the situation has changed.)
Saving seems to work ok on my home computer however on my work computer I get a different error message which is
Cannot find a valid tinymist binary. Some features like auto-formatting on Enter may not work. Please check your tinymist.serverPath configuration. Exception: Error: Could not find a valid tinymist binary.
Bundled (‘d:\VSCode-win32-x64-1.124.2\data\extensions\myriad-dreamin.tinymist-0.15.2-win32-x64\out\tinymist.exe’): failed to probe:
error: spawnSync d:\VSCode-win32-x64-1.124.2\data\extensions\myriad-dreamin.tinymist-0.15.2-win32-x64\out\tinymist.exe UNKNOWN
In PATH (‘tinymist.exe’): failed to probe:
error: spawnSync tinymist.exe ENOENT
I’m not sure if it is looking in the wrong place and there is a way I can update the path?
If I remember correctly, that d:\VSCode-win32-x64-1.124.2\data\extensions\myriad-dreamin.tinymist-0.15.2-win32-x64\out\tinymist.exe should be downloaded automatically when installing the VS Code extension. Usually there’s no need to change the path.
Could you check if that file exists and is valid? Execute path/to/tinymist.exe --version in PowerShell, and it should output something like the following.
I’m not sure, but perhaps you can try to download a standalone tinymist.exe.
To do so, visit Release v0.15.2 · Myriad-Dreamin/tinymist · GitHub, click Download Binary, scroll to Download tinymist 0.15.2, and choose x64 Windows. If tinymist.exe in the downloaded ZIP can be executed on your work computer, then there might be a way to let VS Code use that.
Try this Typst Ultra - Visual Studio Marketplace
it’s a pure WASM version which is portable and it doesn’t need any external binaries to be installed on your computer.