Diagnostics

LUM3013: $ reference before its declaration

A top-level <style> block references a const declared after it.

Severity: error · Category: styles (3xxx)

Reported by: the compiler.

#What it means

Top-level blocks are masked into the module as statements that read their references, so a reference before the const declaration would be a temporal-dead-zone error in the code TypeScript checks.

#Example

stsx
<style>
  .card { border-radius: $radius; }
</style>

const radius = "12px";

#How to fix it

Move the block below the declarations it references. By convention, top-level blocks go at the end of the file.