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_STYLE_OBJECT_UNSUPPORTED

This style object shape is not supported: 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_STYLE_OBJECT_UNSUPPORTED: style={<valueSource>} uses <reason>, which style objects do not support. Supported: an object literal written on the element, or an unmodified same-file `const` object literal referenced by name or flattened with `...spread`, with keys that are plain names or compile-time strings and values that are literals, state, computed values, or props.
A style object is turned into CSS text while compiling, so every key must be readable from the source and every value must be one the compiler can recombine into the same text the server renders and the browser rewrites. Objects that are imported, held in state, mutated, aliased, or built at runtime cannot be frozen that way.
Write the declarations directly on the element, such as style={{ color: theme, marginTop: 8 }}, move the object into an unmodified same-file const, or pass a CSS string.

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?