Skip to content

Error messages

View Markdownllms.txt

The Ribalta compiler never stops at the first problem: it always produces the best document it can, plus a list of diagnostics. Each diagnostic has:

PartExample
SeverityError (something was dropped or does not work) or warning (it works, but probably not the way you wanted).
CodeR209. The code is stable and does not change between versions.
PositionLine and column of the problem.
Messageunknown attribute: colr
HintDid you mean color?

Errors inside a component are reported on the line where the component is used, with the suffix “(in component name)”. Errors in a @style are reported once, at the definition, not at every use.

FamilyTopic
F1xxStructure: blocks, tables, code, charts and icons.
F2xxAttributes: brace syntax, styles and attribute names.
F3xxAttribute values.
F4xxComponents and named slots.
F5xxPreamble definitions and the base theme.
F6xxVariables, data, expressions, repetition and state.
F7xxNavigation between pages.

Error. Message: ::: closes a block, but no block is open here.

A ::: alone on a line closes the last open block. Here there is no open block, usually because of an extra :::.

# Results
We grew 38%.
:::

How to fix: remove the line or open a block before it, such as ::: columns.

Error. Message: block columns was opened but never closed.

Every block opened with ::: name needs a ::: line that closes it. Each page is read on its own, so the block must be closed before the next ---.

::: columns
Left
Right

How to fix: add a line containing only ::: at the end of the block.

Error. Message: @theme can only be used at the start of the document, before the first page.

Definitions with @ (@title, @theme, @color, @style, @component and the others) only work in the preamble. Once the first page starts, they are dropped.

# Opening
---
@theme ink
# Second page

How to fix: move the definition to the top of the file, before any content.

Error. Message: missing block name after :::.

A line that starts with ::: or :: and has other content needs the block name right after it.

::: {.card}
Text
:::

How to fix: write the block name before the attributes, as in ::: box {.card}.

Error. Message: unclosed code block.

A code block opened with ``` needs another ``` line to end it. Without it, the rest of the page becomes code.

```js
console.log("hi")

How to fix: close the block with a line containing ```.

Error. Message: table without a separator line after the header.

The second line of a table must be the separator line, which divides the header from the data.

| Product | Price |
| Coffee | 12 |

How to fix: add a line like | --- | --- | right below the header.

R107 · Table row with a different number of columns

Section titled “R107 · Table row with a different number of columns”

Warning. Message: this row has 3 columns, but the header has 2.

A table row has more or fewer cells than the header.

| Product | Price |
| --- | --- |
| Coffee | 12 | extra |

How to fix: give every row the same number of cells as the header. To write | inside a cell, use \|.

Error. Message: unknown block: colums.

The name after ::: or :: is neither a built-in block nor a component defined in the document or the base theme. The hint suggests the closest name.

::: colums
Text
:::

How to fix: fix the name (here, columns) or define the component with @component. See the list in Blocks.

Warning. Message: divider does not accept content; use :: divider on a single line.

icon, spacer and divider have no content. When opened with :::, the content between them and the closing ::: is ignored.

::: divider
Text
:::

How to fix: use the single-line form, :: divider, and put the text outside the block.

Warning. Message: the text 3 after grid will be ignored.

Only icon and spacer take a value after the name. On the other built-in blocks, loose text is ignored.

::: grid 3
A
B
C
:::

How to fix: use attributes in braces, as in ::: grid {cols=3}.

Error. Message: the chart needs a table with the data.

The chart block draws the data of a Markdown table placed inside it. Without a table, the chart is not drawn.

::: chart {type=bar}
Sales per month
:::

How to fix: put a table inside the block. The first column holds the labels and the others are the series. See Charts.

Error. Message: twelve is not a number.

Every data cell of a chart, except the first column, must be a number. The invalid cell counts as 0.

::: chart
| Month | Sales |
| --- | ---: |
| Jan | twelve |
:::

How to fix: use numbers such as 42, 3.5 or 3,5. A trailing % is accepted.

Error. Message: the chart table needs at least one column of values.

The table only has the label column, so there is nothing to draw.

::: chart
| Month |
| --- |
| Jan |
:::

How to fix: add at least one column of values to the table.

Error. Message: provide the icon name.

:: icon {size=3xl}

How to fix: write the name after icon, as in :: icon rocket {size=3xl}. The names are listed in Icons.

Error. Message: unknown icon: rockets.

The name is not in the list of built-in icons. When there is a similar name, the hint suggests it.

:: icon rockets

How to fix: use a name from the list in Icons, such as rocket.

Error. Message: input needs bind with the variable that holds the text.

@state name = ""
# Who are you?
:: input {placeholder="Your name"}

How to fix: bind the field to a text or number @state with bind: :: input {bind=$name placeholder="Your name"}. The same error appears when bind does not start with $.

Error. Message: sound needs the address of the audio file.

# The door
:: sound {name=door}

How to fix: write the address after sound: :: sound https://example.com/door.mp3 {name=door}.

Error. Message: . must be followed by a name.

Inside braces, . must be attached to a style name and # to an id.

Text {. color=accent}

How to fix: write the name right after it, as in {.highlight} or {#opening}, or remove the loose character.

Error. Message: unclosed quotes in attribute value.

A value that starts with a quote must end with the same quote.

![Photo](https://example.com/photo.jpg){fit="cover}

How to fix: close the value with the quote that opened it: {fit="cover"}. At the end of headings, paragraphs and blocks, braces with an open quote are not recognized as attributes and show up as text on the page.

Error. Message: attribute color has no value after =.

There is an = with nothing after it. It usually comes with an R301, because the empty value is also invalid.

# Heading {color=}

How to fix: provide the value ({color=accent}) or remove the attribute.

Error. Message: invalid text in attributes: @highlight.

Inside braces, only .style, #id, key=value, key="value with spaces" and key are accepted.

Text {@highlight}

How to fix: use the right form, here {.highlight}. Attribute names start with a letter.

Warning. Message: #id only works on the page separator and at the end of blocks.

Ids identify pages and blocks, for links such as [back](#opening). On inline spans, the id is ignored.

Text [highlight]{#start}

How to fix: put the id on the page separator, as in --- {#start}, or at the end of the block’s line.

Error. Message: style .loop references itself.

A @style includes itself, directly or through other styles. Since the style does not exist yet while its own definition is read, the compiler also shows an R207 at the same spot.

@style loop {.loop color=accent}
Text {.loop}

How to fix: remove the circular reference. A style can only include styles defined before it.

Error. Message: unknown style: .highlite.

The name after the . is not a built-in style, a @style or a color token. The hint suggests the closest name.

Text {.highlite}

How to fix: fix the name or declare the style at the start of the document with @style name {attributes}. See the built-in styles.

Warning. Message: another page already uses the id #summary.

Two pages have the same id, so a #summary link can only lead to one of them.

--- {#summary}
# Summary
--- {#summary}
# Conclusion

How to fix: give each page a different id.

Error. Message: unknown attribute: colr.

The name is neither a style attribute nor an attribute of the block it appears on. The hint suggests the closest name or lists the attributes accepted there.

# Heading {colr=coral}

How to fix: fix the name. Block attributes, such as cols or fit, only work on the right blocks. See Attributes.

Warning. Message: key does nothing without click.

The key runs the element’s click actions; without them, pressing the key changes nothing.

# Map
[North]{key=up}

How to fix: say what the key does with click: [North]{click="$y = $y - 1" key=up}.

Error. Message: another block already uses the id #phase, or the id #phase already belongs to a page.

A block id ({#phase} at the end of the opening line) must lead to a single place. It cannot repeat or equal a page id.

First {#phase}
Second {#phase}

How to fix: give each block a different id.

R212 · Feature outside the lesson profile

Section titled “R212 · Feature outside the lesson profile”

Error. Only appears with the lesson profile (ribalta check --profile lesson or "profile": "lesson" in the options). Message: sound is not allowed in lessons.

A lesson is text only. The profile rejects images from http:// or https:// addresses, sound, input, @persist and the next and hidden page attributes.

# Photosynthesis
![Chloroplast](https://example.com/chloroplast.png)

How to fix: store the image in the program you write in (asset:) or remove the feature.

Error. Only appears when the program that compiles passes a nonexistent profile in the options. Message: unknown profile: class.

The other options, such as page, still apply and the document is compiled without a profile.

How to fix: use "profile": "lesson" or omit the field.

Error. Message: depends on the attribute, for example invalid size: huge or unknown color: corall.

The attribute exists, but the value is not accepted. The attribute is ignored, and the hint says which values are valid.

# Heading {size=huge color=corall}

Common cases:

CaseInvalid exampleValid example
Unknown color or malformed hexcolor=corall, color=#12color=coral, color=#123
Color opacity outside 0 to 100color=accent/150color=accent/40
Name outside the scale or number out of rangesize=huge, pad=900size=5xl, pad=xl
Font not declaredfont=titlefont=display or @font title …
Invalid weightweight=450weight=500
Invalid booleanitalic=maybeitalic or italic=false
Invalid alignmentalign=middlealign=center
Invalid shadowshadow=xlshadow=lg
Border wider than 40border="80 coral"border="4 coral"
Invalid lengthw=200%, w=halfw=50%, w=480
Attribute that needs a value, used alone{size}{size=xl}
Address not allowed in a link or image[x](javascript:…), ![x](file.png)https://…, asset:<id>
Invalid image fitfit=stretchfit=cover
Grid columns outside 1 to 12cols=20cols=4
Invalid column proportionswidths="a b"widths="2 1"
Invalid chart typetype=radartype=line
Invalid spacer size:: spacer huge:: spacer 3xl
Step outside 1 to 99step=0step=1

How to fix: use one of the values given in the hint. The full scales and ranges are in Attributes.

Warning. Message: widths has 3 values, but there are 1 columns.

The number of proportions in widths differs from the number of children of the columns block.

::: columns {widths="2 1 1"}
Left
:::

How to fix: give one proportion per column, or adjust the columns. Remember that each direct child is a column; group several elements with ::: stack.

Error. Message: $content can only be used inside a @component.

$content marks where the content passed to a component goes, so it only makes sense in the body of a @component.

# Heading
$content

How to fix: remove the line or move it into a component body. To write the literal text, use \$content.

Error. Message: component echo uses itself.

A component uses itself, directly or through other components. Components have no recursion, so the use is dropped.

@component echo
:: echo
@end
:: echo

How to fix: remove the circular use from the component body.

Error. Message: components nested too deeply (limit: 16 levels).

A component uses another, which uses another, and so on, for more than 16 levels. The example below is abbreviated: with all 17 definitions written out, the error shows up on the use of n1.

@component n1
:: n2
@end
@component n2
:: n3
@end
// n3 to n16 follow the same pattern, each one using the next
@component n17
End
@end
:: n1

How to fix: simplify the chain of components by merging intermediate levels.

Error. Message: components only accept parameters, not .styles or #id.

When using a component, the braces only accept named parameters.

@component badge {text}
::: box {.card}
$text
:::
@end
:: badge {.dark text=New}

How to fix: wrap the component in a block with the style (::: box {.dark} … :: badge {text=New} … :::) or add a parameter for it.

Error. Message: component badge has no parameter tone.

The parameter was not declared in the component definition. The hint lists the existing parameters.

@component badge {text}
::: box {.card}
$text
:::
@end
:: badge {text=New tone=accent}

How to fix: fix the name or declare the parameter, as in @component badge {text tone=accent}.

R408 · Loose text after the component name

Section titled “R408 · Loose text after the component name”

Error. Message: components take named parameters in braces.

Components do not take positional values: every parameter needs a name.

@component badge {text=New}
::: box {.card}
$text
:::
@end
:: badge Sale

How to fix: pass the value as a named parameter: :: badge {text=Sale}.

Error. Message: missing required parameter text of component badge.

Parameters declared without a default value are required.

@component badge {text}
::: box {.card}
$text
:::
@end
:: badge

How to fix: provide the parameter (:: badge {text=New}) or give it a default value in the definition (@component badge {text=New}).

Error. Message: component badge uses $title, which is not a declared parameter.

The component body uses $title inside text or an attribute, but title is not in the parameter list.

@component badge {text}
::: box {.card}
## $title
$text
:::
@end
:: badge {text=New}

How to fix: declare the parameter (@component badge {text title}) or fix the name. Alone on a line, $name is a named slot and does not cause this error.

When the name only exists where the component is used (a page’s @state or @let, or a ::: for variable), the message says so: declare the parameter and pass the value, as in :: badge {text=New title=$title}. The @state and @let at the start of the document do not need this.

Warning. Message: component badge does not use $content; the content will be ignored.

The component was used with ::: and received content, but its body has no $content.

@component badge {text}
::: box {.card}
$text
:::
@end
::: badge {text=New}
This paragraph is ignored.
:::

How to fix: add $content to the component body or use the single-line form (:: badge {text=New}).

Error. Message: box is already a language block and cannot be redefined.

The names stack, row, columns, grid, box, steps, notes, chart, icon, spacer, divider and slot are reserved.

@component box
Text
@end

How to fix: pick another name, such as panel or card-box.

Error. Message: component badge was defined more than once.

The same document defines two components with the same name. The second definition is dropped.

@component badge
New
@end
@component badge
Sale
@end

How to fix: remove or rename one of the definitions. Redefining a base theme component in a document is allowed and does not cause this error.

Error. Message: component pair has no slot side-c.

::: slot fills a slot that the component does not declare. The hint suggests the closest name.

@component pair {title}
## $title
$content
$side-b
@end
::: pair {title=Comparison}
Before
::: slot side-c
After
:::
:::

How to fix: use the name of an existing slot (here, side-b) or declare the slot in the component with $side-c alone on a line.

Error. Message: provide the slot name.

@component pair {title}
## $title
$content
$side-b
@end
::: pair {title=Comparison}
Before
::: slot
After
:::
:::

How to fix: write the slot name after slot, as in ::: slot side-b.

Error. Message: ::: slot can only be used inside a component.

::: slot only works as a direct child of a container component use. Outside one, the compiler also warns that the name is ignored (R110).

::: slot side-b
After
:::

How to fix: put the ::: slot inside ::: component … :::, or remove the block.

Error. Message: slot side-b was filled more than once.

@component pair {title}
## $title
$content
$side-b
@end
::: pair {title=Comparison}
::: slot side-b
After
:::
::: slot side-b
Again
:::
:::

How to fix: merge the content into a single ::: slot side-b.

Error. Message: invalid value for kind: primari.

The parameter declares its accepted values with |, and the value used is not one of them. The component uses the first value of the list instead.

@component button {label kind=primary|secondary}
**$label**
@end
:: button {label=Send kind=primari}

How to fix: use one of the declared values, such as kind=primary.

Error. Message: key cannot be a parameter: it is already an attribute of the component’s usage.

step, if, click and key are attributes that any component usage accepts. A parameter with the same name would hide them: :: button {key=1} would fill the parameter, and the keyboard shortcut would be lost.

@component button {key text}
**$key** $text
@end
# Menu
:: button {key=1 text=Start}

How to fix: give the parameter another name, such as hotkey: @component button {hotkey text}. On usage, key=1 is the shortcut again.

Error. Message: @title needs a value.

@title, @author, @theme, @version and @page need a value on the same line.

@title
# Opening

How to fix: provide the value, as in @title Annual report, or remove the line.

Error. Message: @color expects a name and a value.

@color
# Opening

How to fix: provide the token name and the color, as in @color brand #ff6b4a.

Error. Message: @style expects a name and attributes.

@style highlight
# Opening

How to fix: provide the name and the attributes in braces, as in @style highlight {color=coral weight=bold}.

Error. Message: @component without @end (or @header, @footer, @overlay).

Without @end, the rest of the document is read as the block body, and the document ends up with no pages.

@component badge {text}
::: box {.card}
$text
:::
# Opening

How to fix: end the @component, @header, @footer or @overlay with an @end line.

Error. Message: @end without an open block.

An @end line appears with no open @component, @header, @footer or @overlay before it.

@end
# Opening

How to fix: remove the @end or add, before it, the @component, @header, @footer or @overlay it should close.

Error. Message: unknown definition: @theem.

The name after @ is not a language definition. The hint suggests the closest one.

@theem ink
# Opening

How to fix: use one of the definitions: @title, @author, @theme, @version, @page, @color, @font, @style, @component, @header, @footer, @overlay, @let, @state, @extern, @data, @transition, @mode, @persist, @scorm or @end.

Error. Message: font name without closing quotes.

@font title "Bebas Neue 400
# Opening

How to fix: close the quotes after the family name: @font title "Bebas Neue" 400.

Error. Message: invalid font name: Open-Sans.

The family name can only contain letters, numbers and spaces, and cannot be empty.

@font title "Open-Sans"
# Opening

How to fix: use the family name as it appears on Google Fonts, in quotes: @font title "Open Sans".

Error. Message: invalid font weight: 450.

@font title "Inter" 450
# Opening

How to fix: use weights from 100 to 900, in steps of 100, such as 400 or 500.

Error. Message: @component needs a name.

@component {text}
$text
@end

How to fix: write the name right after @component: @component badge {text}.

Error. Message: invalid component name: Badge.

Component names start with a lowercase letter and use only lowercase letters, numbers and hyphens.

@component Badge {text}
$text
@end

How to fix: use a name such as badge or new-badge.

R512 · Component parameter with a style or id

Section titled “R512 · Component parameter with a style or id”

Error. Message: component parameters do not accept .style or #id.

The braces after @component declare parameters, not styles.

@component badge {.card text}
$text
@end

How to fix: remove the .style or #id from the list and apply the style to a block in the body, such as ::: box {.card}.

Error. Message: unknown theme: dark.

The theme does not exist, and the document falls back to the paper theme.

@theme dark
# Opening

How to fix: use paper, ink or editorial. See Built-in themes.

@theme does not create or name a theme: it only picks the base. To have your own theme, keep a base and adjust it with @color, @font and @style. See Themes.

Error. Message: unsupported language version: 3.

@version 3
# Opening

How to fix: use @version 2, the current version, or remove the line.

Error. Message: invalid page size: 16:9.

@page takes the size in pixels, not a proportion. Width and height go from 16 to 16384, and the height can be auto.

@page 16:9
# Opening

How to fix: use width x height, as in @page 1920x1080, or the key form, as in @page width=800 height=auto. See Page sizes.

The same code appears for width and height on the page separator, with the messages invalid page width and invalid page height:

# Opening
--- {width=10 height=tall}
# Vertical

How to fix: use a number from 16 to 16384 (width=1080) and, for the height, a number or auto (height=1920).

Error. Message: invalid color name: Brand.

Color tokens start with a lowercase letter and use only lowercase letters, numbers and hyphens.

@color Brand #ff6b4a
# Opening

How to fix: use a name such as brand or brand-dark.

Error. Message: invalid font name: Title.

The token name (the first word after @font) follows the same rule as color tokens.

@font Title "Bebas Neue" 400
# Opening

How to fix: use a name such as title, and apply it with {font=title}.

Error. Message: invalid style name: Highlight.

@style Highlight {color=accent weight=bold}
# Opening

How to fix: use lowercase letters, numbers and hyphens, such as highlight.

Error. Message: the base theme can only contain definitions, not pages.

It only appears when checking the base theme, never in documents. The example below is the text of the base theme.

@theme ink
@color brand #12a37f
# Opening

How to fix: keep only lines that start with @ (@theme, @color, @font, @style and @component) in the theme, plus blank lines and comments. Page content goes in each document.

R520 · @title or @author in the base theme

Section titled “R520 · @title or @author in the base theme”

Warning. Message: @title in the base theme is ignored; set it in each document.

It only appears when checking the base theme. Title and author belong to each document, so they are ignored in the theme.

@title Annual report
@theme ink

How to fix: remove the line from the theme and write @title or @author at the start of each document.

Section titled “R521 · Repeated @header, @footer or @overlay”

Error. Message: @footer was defined more than once.

Each document has one header, one footer and one overlay. The second block is ignored.

@footer
Confidential
@end
@footer
$page / $pages
@end
# Opening

How to fix: put all the content in a single block, for example with ::: columns. See Header and footer.

Section titled “R522 · Unknown field in the header, footer or overlay”

Error. Message: @footer uses $pagina, which is not an available field.

Inside @header, @footer and @overlay, $ followed by a name is an automatic field. The hint suggests the closest field.

@footer
Page $pagina
@end
# Opening
---
# Agenda

How to fix: use one of the fields: $page, $pages, $title, $author or $date.

Section titled “R523 · Step-by-step reveal in the header, footer or overlay”

Warning. Message: @footer is always shown in full; step and ::: steps are ignored in it.

@footer
::: steps
- First
- Second
:::
@end
# Opening
---
# Agenda

How to fix: remove step and ::: steps from the block. To reveal something gradually, do it inside the page.

Section titled “R524 · Notes in the header, footer or overlay”

Warning. Message: notes (::: notes) inside @footer are ignored.

@footer
Confidential
::: notes
Remember to mention the contract.
:::
@end
# Opening
---
# Agenda

How to fix: write ::: notes inside the page where the note belongs.

Section titled “R525 · Text on the @header, @footer or @overlay line”

Warning. Message: the text Confidential after @footer will be ignored.

The @header, @footer or @overlay line only accepts attributes in braces. The content goes on the following lines, up to @end.

@footer Confidential
@end
# Opening

How to fix: move the text to the next line. To turn off the footer that comes from the base theme, use @footer none.

R530 · Definition that does not fit the library item kind

Section titled “R530 · Definition that does not fit the library item kind”

Error. Message: @theme cannot be used in a palette.

Each library item kind accepts only some definitions: palettes take @color and @font; styles also take @style; components also take @component; themes accept any theme definition.

@theme paper
@color brand #349ef4

How to fix: delete the highlighted line or save the item with another kind, for example Theme instead of Palette.

R531 · Library item without a main definition

Section titled “R531 · Library item without a main definition”

Error. Message: choose which component is the main one.

Library components and styles must say which definition is the main one, the one people call when they use the item.

How to fix: say which definition is the main one when saving the item.

Error. Message: component not found: card.

The chosen main definition does not exist in the item text, or it was renamed.

How to fix: pick another main definition or fix the name in the text.

Error. Message: unknown item kind: page.

The item was sent with a kind the library does not know. Valid kinds are theme, component, style and palette (templates are validated as themes).

How to fix: save the item again with one of the valid kinds.

Error. Message: unknown mode: play.

@mode play
# Opening

How to fix: use @mode default (the default) or @mode game.

Error. Message: unknown variable: $totl.

An expression, if, for or click uses a name that was not declared with @let, @data or @state, or a field the record doesn’t have. Outside expressions, an undeclared $name stays as text.

@let total = 10
::: if $totl > 5
Many items
:::

How to fix: fix the name (the hint suggests the closest one) or declare the variable.

Error. Message: expected number, but the value is text.

The value doesn’t have the type the operation expects: arithmetic on text, a condition that is not true/false, a field on something that is not a record, or a @state receiving another type.

@let name = Ana
# $($name * 2)

How to fix: use values of the right type. For conditions, compare: $total > 0.

Error. Message: the expression ended too early.

The expression is badly written: a value, a parenthesis or a quote is missing, or there is a character that is not part of the language.

# Total: $(10 +)

How to fix: complete the expression. To compare, use == (not =).

Error. Message: this value depends on the document state and cannot be used here.

@state values (and $step) can only be used in conditions (if), variants (.style=condition), text and click. Visual attributes, @let and for lists need fixed values.

@state mode = light
# Hello {color=$mode}

How to fix: use a variant: @style dark {color=ink} and {.dark="$mode == dark"}.

Error. Message: $total cannot be changed.

A click tries to change a @let, a @data, a component parameter or a for variable. Only @state changes while the document is shown.

@let total = 0
[Add]{click="$total = $total + 1"}

How to fix: declare the variable with @state total = 0.

Error. Message: for needs a list, but the value is number.

The for didn’t get a list, is badly written, depends on state or would exceed the limit of 500 repetitions in the document.

@let total = 3
::: for item in $total
$item
:::

How to fix: use a list (@data, [a, b]) or a range (1..3).

Error. Message: else must come right after an if block.

::: else and ::: else if must come immediately after a ::: if (or another else if) in the same block. Another block in between, or a second else, breaks the sequence.

# Title
::: else
Alternative
:::

How to fix: place the ::: else right after the matching ::: if … :::.

Warning. Message: $plan never gets the value prro.

A condition compares a text @state with a value that is neither the initial value nor assigned by any click. It’s usually a typo.

@state plan = pro
::: if $plan == prro
Pro plan
:::

How to fix: fix the value (the hint lists the values in use).

Error. Message: @let expects a name, = and a value.

A @let or @state without = or with an invalid name, a @data without a name or a table, or a @data field with an invalid name.

@let highlight coral

How to fix: write @let highlight = coral. Names use lowercase letters, numbers, hyphens and underscores.

Error. Message: $total was already defined.

@let, @data and @state share the same names, which must be unique. step is reserved for the current step.

@let total = 1
@state total = 2

How to fix: give the variables different names.

Error. Message: invalid action: skip.

The click value is not a known action.

[Next]{click="skip"}

How to fix: use $x = value, toggle $x, go #id, go back, go next or go prev, separated by ;.

Error. Message: on-enter can only change state; go, back, next and prev are not allowed.

on-enter runs when the page is entered. Changing pages there would move to another page without anyone asking for it, and could create a loop.

--- {on-enter="go #end"}
# Introduction

How to fix: keep only $x = value and toggle $x in on-enter. To choose the following page, use next=#id on the separator.

Error. Message: random can only be used in actions (click and on-enter).

random and pick draw a new value on every call. In text, in a condition or in a @let, the result would change every time the screen is drawn.

@state die = 0
# Your turn
You rolled $(random(1, 6))

How to fix: draw inside an action and store the result in a @state: [Roll]{click="$die = random(1, 6)"} and You rolled $die.

Error. Message: on-timeout needs timeout on the same page.

# Opening
--- {on-timeout="go next"}
# Introduction

How to fix: say how many seconds to wait on the same separator: --- {timeout=30 on-timeout="go next"}.

Error. Message: this page has no sound dor.

play and stop only reach the sounds declared with :: sound on the same page.

# The door
:: sound https://example.com/door.mp3 {name=door}
[Open]{click="play dor"}

How to fix: fix the name or declare the sound on the page with {name=…}.

Error. Message: another sound door already exists on this page.

How to fix: give each :: sound on the page a different name.

R617 · @persist with something that is not state

Section titled “R617 · @persist with something that is not state”

Error. Message: @persist only keeps @state variables, and $fixed is not one.

@let fixed = 1
@persist fixed
# Opening

How to fix: list only variables declared with @state at the start of the document.

Error. Message: score in @scorm must be a numeric @state variable, and $name is not.

@state name = "Ana"
@scorm score=$name
# Opening

It also appears for an unknown parameter (only score, complete, max and pass exist), for max or pass that are not positive numbers, for pass greater than max and when both score and complete are missing.

How to fix: use a numeric @state as the score, such as @state points = 0 and @scorm score=$points complete=#end.

Error. Message: $round comes from outside the document (@extern) and is not changed by actions.

@extern round = 1
# Scoreboard
[Next]{click="$round = $round + 1"}

It also appears in :: input {bind=$round}, in @persist round and in @scorm score=$round.

How to fix: let the program that shows the document set the value, or declare it with @state if the document itself should change it.

Error. Message: actions cannot use $thing, which only exists while the repetition is drawn.

@state backpack = [map, key]
@state chosen = ""
# Backpack
::: for thing in $backpack
[$thing]{click="$chosen = $thing"}
:::

It appears when a ::: for walks a list that changes while the document is shown (@state or @extern) and an action uses the item or its position.

How to fix: use the item in text, if or variants; for actions, use @state values.

Error in click="go #id" and next=#id; warning in [text](#id) links. Message: there is no page with the id #end.

[Go to the end]{click="go #end"}

How to fix: give the destination page that id (--- {#end}) or fix the name.

Warning. Message: hidden page #extra is not reached by any link or go.

A page with hidden doesn’t appear in the normal flow; without a link, go or next pointing to it, nobody can see it.

# Start
--- {#extra hidden}
Details

How to fix: link to the page ([Details](#extra)) or remove hidden.

These only appear in the command line, with ribalta check --check-assets, which goes online to check images and sounds.

Warning. Message: the image https://example.com/photo.jpg answered 404.

# Team
![Team photo](https://example.com/photo.jpg)

It also appears when the address does not answer (wrong domain, no connection) and when it is a web page rather than the file: for example, the link to a photo on Unsplash instead of the image address.

How to fix: open the address in the browser. If it is a page, right-click the image and copy its address. If the file does not exist or requires a login, store the image in the program you write in (asset:).