Skip to content
These are temporary community docs. The official docs are in progress.Help improve them
Markless
Esc
↑↓navigate↵open⌘Jpreview
On this page

MARKLESS_ROSTER_COUNT_NOT_A_NUMBER

roster count is spent as a number before the page can answer it: a Markless compiler error.

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

What happened

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

MARKLESS_ROSTER_COUNT_NOT_A_NUMBER: Cannot spend the roster count "<computedName>" in <operation> ("<source>") in <componentName>: at server render the count is a placeholder the renderer resolves once the page has composed, so only a bare read printed as text or as an attribute value carries it.<arrivedAs>
A count is how many parts END UP in the family instance, and a single forward render pass cannot know that when the asker renders. The render writes a placeholder and the served page answers every one it wrote, which a printed value carries and an operation destroys - the comparison or the arithmetic runs against the placeholder string and paints a wrong value silently.
Print <computedName> on its own - {<computedName>}, an attribute value, or a ${<computedName>} slot in a template literal - and do the arithmetic in an event handler or in CSS, where the count is a number.
https://markless.dev/errors/MARKLESS_ROSTER_COUNT_NOT_A_NUMBER

Words in angle brackets change from case to case.

How to fix it

Start with the suggestion in the message above.

This page has no guide yet. Help write it.

Where it comes from

@markless/compiler raises this code. Source:

Read how to read a Markless error, or go back to all error codes.

Was this page helpful?