Many rendering and text-sizing problems are fixed in newer releases. Check your version with
npm ls loom-dev.
Quick index
| Symptom | Cause | Fix |
|---|---|---|
Blank page, [loom] nothing mounted into #loom-root after 2s | Entry exports instead of mounting | Call createRoot().render(...) at top level |
ReferenceError: UDim2 is not defined in a built page | The plugin couldn’t find your entry | import "@loom-dev/preview/globals" first in the entry |
Invalid hook call / two React copies | Stale optimizer cache, or React 19 | rm -rf node_modules/.vite; pin React 18 |
Failed to resolve entry for package "@loom-dev/layout" | Plugin imported by file path | Import @loom-dev/preview/vite |
no index.html and no client entry found | No entry under the root | Pass entry, or targets for a gallery |
no targets matched … — nothing to build | Glob missed, or unsupported glob syntax | Only **, **/ and * are supported |
Package "…" only provides a Lua/Luau runtime | A declaration-only roblox-ts package | Add a shims entry |
RollupError: Expected ';', '}' or <eof> in a .luau file, build only | Same as above, reached only by the build | Same as above |
| Renders, but looks wrong | Unimplemented property | Check Supported properties |
| Text or buttons spill out of their container | Content wider than the parent | Expected: AutomaticSize is bounded by the parent |
| Runs off the edge on a phone | The scene lays out against the real viewport | Add ?base=960; see Previews on a phone |
no face is loaded for the Roblox font family "…" | A font loom can’t ship, such as Gotham | Register your own copy |
| A list orders itself alphabetically | SortOrder defaults to Name, as in Studio | Set SortOrder={Enum.SortOrder.LayoutOrder} |
| You can’t tell what a preview is doing | Open the debug panel: ?debug=1 or Ctrl+Alt+D |
Blank page: nothing mounted
[loom] nothing mounted into #loom-root after 2s — does your entry callcreateRoot().render(<App />) at the top level?Loom loaded, but your entry rendered nothing. Usually the entry exports a component instead of rendering it:
import { createRoot } from "@rbxts/react-roblox";import { App } from "./App";
createRoot().render(<App />);If that’s already there, loom may have picked a different entry. It uses the first match from a
fixed list, so src/main.client.tsx wins over src/main.tsx. Pass loomPreview({ entry }) to choose.
ReferenceError: UDim2 is not defined
The Roblox globals weren’t installed before your code ran.
-
In a built page: the plugin couldn’t find your entry, for example because of a custom
build.rollupOptions.input. Import the globals first in the entry:import "@loom-dev/preview/globals"; -
In the dev server: an inline
<script type="module">inindex.htmlruns first. Move that code into the entry module.
Two copies of React
Warning: Invalid hook call or “more than one copy of React” means two React instances are loaded.
Check, in order:
- Stale cache. Run
rm -rf node_modules/.viteand restart. - React 19. The preview renderer needs React 18. Pin React 18 in the preview project.
- Shared Vite config.
loomPreview()was added to an app with its own React. Give the preview its own Vite project; see Vite integration.
Failed to resolve entry for package "@loom-dev/layout"
Import the plugin by its package name, never by file path:
import { loomPreview } from "@loom-dev/preview/vite";no index.html and no client entry found
You probably pointed loom at a workspace root instead of an app. Point at the app folder, pass
loomPreview({ entry }), or use gallery mode with --targets.
no targets matched … — nothing to build
A bare directory means <dir>/**/*.loom.tsx. Globs support only **, **/ and *: no braces, ?,
or negation. node_modules and dot-folders are skipped.
A scene renders but looks wrong
Check the property in Supported properties first. Some
props are typed but not drawn, such as UIGradient.Offset and ScrollBarImageTransparency. Tiled
sprite sheets aren’t supported; loom warns when it sees one.
Text is a different size than expected
loom: no face is loaded for the Roblox font family "Gotham" — its text is paintedand measured in the system fallback instead, …A missing font changes layout, not just appearance, because text is measured to size and wrap it.
Loom ships 28 Roblox font families. A few, including Gotham and BuilderSans, can’t be
redistributed, so register your own copy. See Fonts.
The debug panel’s fonts section shows which fonts actually loaded.
Content spills out of its container
AutomaticSize grows only as wide as the parent allows, as in Roblox. Height isn’t capped. Content
that can’t shrink, such as a long word or a row of buttons, overflows the same way it does in Studio.
Give the parent more room, or let the text wrap.
A target throws but the page still works
Intended. In a gallery, each target has its own error boundary. Errors show as a red panel with a stack trace, and the sidebar keeps working.