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_STORAGE_KEY_STATIC

storage() gets a key or fallback that is not a string literal.

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

What happened

Markless reads the storage() key and fallback when it builds your code. So both must be string literals.

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

MARKLESS_STORAGE_KEY_STATIC: storage(key, fallback) requires an explicit key to be a static string literal; omit it to derive markless:<identifier>.
The compiler bakes the key into a stable graph identity and storage key at compile time; it cannot be a runtime value.
Pass a string literal, for example `storage('theme', 'light')`, or omit the key: `storage('light')`.
https://markless.dev/errors/MARKLESS_STORAGE_KEY_STATIC

Words in angle brackets change from case to case.

How to fix it

Pass string literals, like storage('theme', 'light'). Or leave out the key: storage('light').

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?