Automattic/harper · error

Typst is not supported in this version of Harper. Please use

Error message

Typst is not supported in this version of Harper. Please use the Typst-supported binary.

What it means

harper-wasm's create_parser supports the Typst language only when compiled with the `typst` cargo feature. Without it, requesting a Typst parser panics and tells you to use the Typst-supported (feature-enabled) build of Harper.

Source

Thrown at harper-wasm/src/lib.rs:78

    Markdown,
    Typst,
}

impl Language {
    fn create_parser(&self) -> Box<dyn Parser> {
        match self {
            Language::Plain => Box::new(PlainEnglish),
            // TODO: Have a way to configure the Markdown parser
            Language::Markdown => Box::new(Markdown::default()),
            Language::Typst => {
                #[cfg(feature = "typst")]
                {
                    use harper_typst::Typst;
                    Box::new(Typst)
                }
                #[cfg(not(feature = "typst"))]
                {
                    panic!(
                        "Typst is not supported in this version of Harper. Please use the Typst-supported binary."
                    )
                }
            }
        }
    }
}

/// Specifies an English Dialect, often used for linting.
#[wasm_bindgen]
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
pub enum Dialect {
    American,
    British,
    Australian,
    Canadian,
    Indian,
}

View on GitHub (pinned to 5fe7d5ab76)

Solutions

  1. Use the Typst-supported build of Harper (the release compiled with the typst feature).
  2. When building harper-wasm yourself, add the feature: `wasm-pack build -- --features typst`.
  3. If Typst support isn't needed, stop requesting the "Typst" parser and handle other languages only.

Example fix

// before
const parser = await createParser("Typst"); // panics on default build
// after (build with typst feature, or guard)
if (typstSupported) {
  const parser = await createParser("Typst");
} else {
  const parser = await createParser("Markdown");
}
Defensive patterns

Strategy: fallback

Validate before calling

// Check feature support before requesting Typst
const supportsTypst = /* from build/release notes */ false;
const parserType = supportsTypst ? "Typst" : "Markdown";

Try / catch

try {
  parser = await createParser("Typst");
} catch (e) {
  console.warn('Typst not supported in this build; falling back');
  parser = await createParser("Markdown");
}

Prevention

When it happens

Trigger: Calling createParser (or create_lint_parser) with a parser type of "Typst" against a harper-wasm build compiled without `--features typst`.

Common situations: Using the default npm-published harper.js/wasm build which ships without the Typst feature; upgrading Harper and newly requesting Typst support; self-building harper-wasm without enabling the feature flag.

Related errors


AI-assisted analysis of Automattic/harper@5fe7d5ab76 (2026-09-06). Data as JSON: /api/errors/709c98cb694abb77. Report an issue: GitHub.