Velaguides

Troubleshooting

Find the fix by symptom, especially for problems the build doesn't report.

Most mistakes show up as diagnostics. This page covers the rest: something looks wrong and the build said nothing.

”A class did nothing”

Most likely causes first:

  1. The utility doesn’t apply to that element. <frame className="text-red-500" /> compiles, but a Frame has no TextColor3. The editor warns unsupported-host-utility. The build does not.
  2. The class is on a component that doesn’t forward it. <Panel className="p-4" /> passes Panel props and helper children. Panel must spread unknown props onto a host element and render children. See How it works.
  3. The class is computed at runtime. A typo in a computed string isn’t checked. See dynamic class names.
  4. Your roblox-ts drops Vela’s warnings. Vela reports through context.addDiagnostic. Test it by compiling className="bg-nope-500". You should see a warning.
  5. The editor stays quiet while you type a partial key. bg-slat has no squiggle because it’s a prefix of a real key. The build still warns.
  6. transition on an element that never changes. It’s dropped with transition-without-runtime. Add the hover: or breakpoint rule it should animate.

”The editor flags a class the build accepts”

The build is the source of truth, so this is an editor bug. Upgrade the extension.

The one intended difference: per-element rules (unsupported-host-utility) are checked only in the editor.

The editor also has two lints the build never runs: overridden-class and canonical-class. To quiet one, set it to "ignore" in velaRbxts.lint.

”The editor ignores a class list outside className”

The editor reads a const string only when a className names it, and only one the compiler would lower. These are skipped:

  • a let, or a const declared after the className that uses it
  • a const declared inside another function
  • the arguments of a helper called outside a className, such as cva(...) at the top of the file

For the helper case, add its name to velaRbxts.classFunctions, and pass --class-functions to vela sort so the CLI sorts the same lists.

”vela sort --check passes on a file I know is unsorted”

Check the path. A file or directory that doesn’t exist is skipped, and the check still exits 0:

Terminal window
npx vela sort --check src/nope.tsx # prints nothing, exits 0

Also check that the list is one the sort reads. A helper’s arguments are sorted only with --class-functions.

”A breakpoint or orientation variant never applies”

  • Chained variants like md:touch: need every condition to match.
  • Breakpoints are minimum widths, so a phone-sized viewport matches none of them.
  • A square viewport counts as landscape.

”The layout is wrong”

left-* or top-* is ignored. The parent has a UIListLayout (from flex, gap-* or space-*), which controls child positions. Position elements only inside a plain frame.

An element sits outside its parent with right-* or bottom-*. These place the element’s top-left corner. Add the matching origin: right-2 bottom-2 origin-bottom-right.

justify-* behaves strangely. justify-center and justify-between set different properties and interact. Use one. See layout and sizing.

Spacing is bigger than expected. Margins add to the parent’s gap-*. Use gap-* alone for list spacing.

Items in a divide-* list are out of order. Vela sets each child’s LayoutOrder. With React:

  • A component child must forward LayoutOrder to its root element.
  • An order-* the parent can’t read, such as hover:order-1, warns divide-unreadable-order.

order-* does nothing. You wrote the layout instance yourself, and its SortOrder defaults to Name. Set SortOrder={Enum.SortOrder.LayoutOrder}.

”The colors are wrong”

An element disappeared. Preflight makes every classed host element start transparent. Add a bg-*, or set preflight: false.

A gradient is a flat color. One stop is transparent, which is dropped without a warning.

bg-* is ignored next to a gradient. Intended. A gradient sets the background to white so its colors show correctly.

A theme color reports unknown-theme-key. Either a top-level theme.colors replaced your theme.extend.colors and the built-in palette, or a vela.config.ts in a subfolder is shadowing the root one. See merge semantics.

Overlapping children darken where they overlap. opacity-* fades each element separately. Add isolate to the parent frame to fade the group as one layer. It must not be inside a variant or branch.

A theme color works on static elements but not dynamic ones. At runtime, Vela only reads Color3.fromRGB(r, g, b) and new UDim(a, b) with plain numbers. See theming.

”Everything is bigger or smaller than expected”

Pixel values scale with the viewport (rem), clamped between 8 and 64 by default. To turn scaling off while you debug:

vela.config.ts
export default defineConfig({ theme: { rem: { min: 16, max: 16 } } });

TextSize stops at 100, the most Roblox supports.

”A prop or a spread I wrote is ignored”

A prop you write on the element beats the class. The build warns:

explicit-prop-overrides-class: Vela: `bg-red-500` generates BackgroundColor3, but this element already declares BackgroundColor3. The declared BackgroundColor3 wins, so the class does not emit one; remove the class or the prop.

A helper child, such as <uicorner>, beats rounded-lg the same way (explicit-helper-overrides-class).

Spreads follow JSX order. In <textbutton className="bg-slate-700" {...props} />, props.BackgroundColor3 wins. Put className after the spread to make the class win.

”The build fails with runtime-not-installed”

Rojo only maps node_modules/@rbxts, and Vela’s runtime isn’t there.

  • pnpm: add publicHoistPattern: ["*@rbxts*"] to pnpm-workspace.yaml (or set nodeLinker: hoisted) and reinstall.
  • npm: run npm ls @rbxts/vela-runtime. If it’s nested under vela-rbxts, pin @rbxts/react@17.3.7-ts.2 and @rbxts/react-roblox@17.3.7-ts.2, delete package-lock.json, and reinstall. Newer @rbxts/react prereleases fall outside the runtime’s peer range.
  • Version mismatch: keep every @rbxts/vela-runtime* package at the vela-rbxts version.

”The build fails on a Vela error”

Any Vela error stops the build, and the failing file isn’t emitted. Common causes:

  • config-resolution-failed: your config doesn’t load. It’s checked on every build.
  • compiler-unavailable: the native compiler couldn’t load on this platform.
  • A vela.css syntax error. See vela.css.

”A margin has no effect under Vide”

Under Vide, the compiler must see m-* classes directly. A margin coming from a function call it can’t read is skipped with a warning. Write the class where the compiler can see it. See the Vide guide.

”className is a type error”

Add the declaration file src/vela-env.d.ts containing import "vela-rbxts";. Don’t name it src/vela-rbxts.d.ts, because the import then points at itself. See installation.

”The build fails on the first file with compiler-invocation-failed”

If the message is Cannot read properties of undefined (reading 'Latest'), your TypeScript is too new. Use typescript@5.9.3 or 6.x.

Otherwise, check your platform has a prebuilt binary. Windows on ARM and Linux arm64 musl don’t.

”The build fails on vela.config.ts”

rbxtsc output
src/vela.config.ts:1:30 - error TS roblox-ts: You cannot use modules directly under node_modules.

The config file is inside src, so roblox-ts compiles it as game code. Move it to the project root.

If ESLint then reports the file as outside the project, add an ESLint override for it, or use vela.config.json. Don’t add it to tsconfig.json’s include.

”Nothing is being transformed at all”

  • The file must end in .tsx. Class names in .ts files are ignored.
  • The tsconfig plugin must be vela-rbxts/transformer, with the subpath.
  • The transformer only runs under rbxtsc, not plain tsc.
  • Files with no className and no JSX are skipped. This is configurable.

”The output is bigger than expected”

A computed className, or an element with a spread, pulls the theme tables into the output. Writing each branch out as a literal string usually avoids that.

Still stuck?

Build the smallest example that shows the problem and read the emitted TSX. A static element keeps its tag and gains plain props. A runtime element becomes VelaRuntimeHost. The five rules explain how to stay static.