Typst Preview is working, but typst compile fails

Hi,

I’m using neovim (AstroNvim) for Typst, Typst Language Pack. It works, my preview looks like I expect. When I try to generate a PDF from the same typ file, I get an error:

master ~/spaces/text/wei> typst compile the-hundred-squares-ru.typ hunnerd.pdf
error: entry does not have field "page"
   ┌─ robinson-toc.typ:67:48
   │
67 │         #subcnt #box(width: 1fr, repeat[.]) #it.page
   │                                                 ^^^^

exit 1
master ~/spaces/text/wei>

I understand that my info is insufficient; what data should I supply? Nevertheless, it looks like the CLI typst lacks some environment that the Preview has. What could that be?

I assume the offending code is part of a show rule for an outline entry.

As the field it.page has been replaced with a function it.page() starting with Typst v0.13, it seems to me that you have the 0.13 release candidate installed. This version of Typst is then used when you run typst compile, whereas typst-preview likely ships its own compiler, which still uses version 0.12.

Exactly! I downgraded typst with

cargo binstall typst-cli --force

and the error’s gone. Now it’s

~> typst --version
typst 0.12.0 (737895d7)
~>

Release on GitHub 737895d. So I shouldn’t use any release candidate in a normal workflow.

Besides, can I be sure that the tinymist language server uses the same version of the language?