I have been migrating my code from the online IDE to VS Code because it stopped compiling quickly enough for my preference and been having some issues.
In particular, I have noticed that certain syntax that works in the online IDE does not work with the local compiler I installed. I installed this compiler first with Homebrew and then manually, both with the same result. I am on an Intel Mac. I have verified that I am using the most recent version of typst, which as of posting is 0.14.2.
Here is a piece of code that doesn’t work locally, but works on the online IDE.
#show outline.entry: it => link(
it.element.location(),
it.indented(it.prefix(), it.inner()),
)
#outline(title: "Table of Contents")
= Test
The error I get is:
error: type content has no method `prefix`
┌─ /(path)/typst
│
3 │ it.indented(it.prefix(), it.inner()),
│ ^^^^^^
Please let me know how I might go about fixing this issue so I can use the most up-to-date commands from typst locally.
Unmodified compiler does not print binary’s path in the error message and includes line:column location of the error.
If you correctly verified the version, the error is impossible, as it’s for v0.12 and older. Run typst -V/typst info to check version and which typst to get full path to the binary. Alternatively, compile this:
#panic(str(sys.version))
VS Code has nothing to do with a local compiler, unless you are talking about Tinymist extension.
Indeed, when I compile your panic line it tells me that I have version 0.12.0. However, when I verify the version with Homebrew it says 0.14.2, and when I installed the compiler manually, I did so with the most recent version from the typst website. I am using the Tinymist extension. Could this have something to do with it? I am confused how I ended up with v0.12.0
Thank you for the help. The problem was that VSCode was not up to date and could not update to the latest version of Tinymist. After updating VSCode and reinstalling Tinymist, the above code works.