{"record":{"id":"709c98cb694abb77","repo":"Automattic/harper","slug":"typst-is-not-supported-in-this-version-of-harper","errorCode":null,"errorMessage":"Typst is not supported in this version of Harper. Please use the Typst-supported binary.","messagePattern":"Typst is not supported in this version of Harper\\. Please use the Typst-supported binary\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"harper-wasm/src/lib.rs","lineNumber":78,"sourceCode":"    Markdown,\n    Typst,\n}\n\nimpl Language {\n    fn create_parser(&self) -> Box<dyn Parser> {\n        match self {\n            Language::Plain => Box::new(PlainEnglish),\n            // TODO: Have a way to configure the Markdown parser\n            Language::Markdown => Box::new(Markdown::default()),\n            Language::Typst => {\n                #[cfg(feature = \"typst\")]\n                {\n                    use harper_typst::Typst;\n                    Box::new(Typst)\n                }\n                #[cfg(not(feature = \"typst\"))]\n                {\n                    panic!(\n                        \"Typst is not supported in this version of Harper. Please use the Typst-supported binary.\"\n                    )\n                }\n            }\n        }\n    }\n}\n\n/// Specifies an English Dialect, often used for linting.\n#[wasm_bindgen]\n#[derive(Serialize, Deserialize, Debug, Clone, Copy)]\npub enum Dialect {\n    American,\n    British,\n    Australian,\n    Canadian,\n    Indian,\n}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/Automattic/harper/blob/5fe7d5ab76492d83f3ecdbc3f1da83c75dcb6f83/harper-wasm/src/lib.rs#L60-L96","documentation":"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.","triggerScenarios":"Calling createParser (or create_lint_parser) with a parser type of \"Typst\" against a harper-wasm build compiled without `--features typst`.","commonSituations":"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.","solutions":["Use the Typst-supported build of Harper (the release compiled with the typst feature).","When building harper-wasm yourself, add the feature: `wasm-pack build -- --features typst`.","If Typst support isn't needed, stop requesting the \"Typst\" parser and handle other languages only."],"exampleFix":"// before\nconst parser = await createParser(\"Typst\"); // panics on default build\n// after (build with typst feature, or guard)\nif (typstSupported) {\n  const parser = await createParser(\"Typst\");\n} else {\n  const parser = await createParser(\"Markdown\");\n}","handlingStrategy":"fallback","validationCode":"// Check feature support before requesting Typst\nconst supportsTypst = /* from build/release notes */ false;\nconst parserType = supportsTypst ? \"Typst\" : \"Markdown\";","typeGuard":null,"tryCatchPattern":"try {\n  parser = await createParser(\"Typst\");\n} catch (e) {\n  console.warn('Typst not supported in this build; falling back');\n  parser = await createParser(\"Markdown\");\n}","preventionTips":["Verify which features your harper-wasm/harper.js build ships with before using Typst.","Build wasm with `--features typst` if your app needs Typst linting.","Document the required binary/feature for Typst users in your app's setup docs."],"tags":["rust","wasm","feature-flag","unsupported"],"backgroundTag":"feature-not-enabled","analyzedSha":"5fe7d5ab76492d83f3ecdbc3f1da83c75dcb6f83","analyzedAt":"2026-09-06T11:34:38.610Z","contentChangedAt":"2026-09-06T11:34:38.610Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}