Reproducible panic: Failed to resolve coordinate: (0, 0) in fletcher:0.5.2 / cetz:0.3.1

Reproducible panic: Failed to resolve coordinate: (0, 0) in fletcher:0.5.2 / cetz:0.3.1

Hi everyone,

I’ve encountered a persistent panic when using the fletcher package for commutative diagrams. The error seems to be rooted in the coordinate resolution of the underlying cetz package.

Environment & Context:

  • Typst Version: 0.14.2 (CLI on Fedora 43)
  • Packages: @preview/fletcher:0.5.2 and @preview/cetz:0.3.1
  • Important: This panic is not limited to a local environment. It occurs consistently in the online editor at typst.app as well, suggesting a fundamental issue in the package interaction or a regression in the latest Typst compiler’s handling of these libraries.

The Issue:

Even a minimal Fletcher diagram triggers a panic. The stack trace points to coordinate.typ in CeTZ. Interestingly, the panic often references (0, 0) even if that coordinate isn’t explicitly used as a node position, likely triggered by internal default values for marks or anchors.

Minimal Reproducible Example:

#import "@preview/fletcher:0.5.2" as fletcher: diagram, node, edge

#diagram(
  node((0,0), $n$),
  node((1,0), $n-1$),
  edge((0,0), (1,0), "->")
)

Please consider migrating to a later fletcher version (0.5.6 - 0.5.8) if you’re using typst 0.14. It looks like fletcher 0.5.2 only works for typst 0.13 or earlier!