---
title: MARKLESS_STYLE_OBJECT_UNSUPPORTED
description: "This style object shape is not supported: a Markless compiler error."
sidebar: { hidden: true }
search: { keywords: ["STYLE_OBJECT_UNSUPPORTED","style object unsupported","markless error"] }
pagination: false
---

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

## What happened

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

```text
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](/contributing/improve-these-docs).

## 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)

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