---
title: MARKLESS_BRANCH_ELSE_SPELLING
description: "An @if branch uses else without the @ sign."
sidebar: { hidden: true }
search: { keywords: ["BRANCH_ELSE_SPELLING","branch else spelling","markless error"] }
pagination: false
---

**Error** from the compiler, while it builds your `.tsrx` files.

## What happened

Without the `@`, the parser does not see a branch. The page shows the word "else" and the code after it as text.

Markless prints the message, the reason, and a suggestion:

```text
MARKLESS_BRANCH_ELSE_SPELLING: This `else` follows an @if arm but is not written as `@else`, so it is not read as a branch at all. TSRX parses it as literal text next to the @if, and the block after it becomes a separate expression, so the page renders the word "else" followed by the arm's own source as escaped text.
Markless branches are spelled with the `@` sigil — `@if`, `@else if`, `@else` — because that sigil is what tells the parser a construct starts here. Without it the parser has no branch to attach the alternative to, and the mistake is silent: the module compiles and ships visible garbage instead of failing.
Write the alternative as `@else { ... }`.
https://markless.dev/errors/MARKLESS_BRANCH_ELSE_SPELLING
```

## How to fix it

Write `@else`, with the `@` sign.

```tsrx
@if (open) {
	<p>Open</p>
} @else {
	<p>Closed</p>
}
```

## Where it comes from

`@markless/compiler` raises this code. Source:

- [packages/compiler/src/passes/semantic-graph/diagnostics.ts](https://github.com/compiled-run/markless/blob/main/packages/compiler/src/passes/semantic-graph/diagnostics.ts)
- [packages/compiler/src/compile-module.ts](https://github.com/compiled-run/markless/blob/main/packages/compiler/src/compile-module.ts)

Read [how to read a Markless error](/tooling/diagnostics), or go back to [all error codes](/errors).
